瀏覽代碼

添加导入专案数据模块

luocaiyang 3 年之前
父節點
當前提交
cc0f6215fa
共有 33 個文件被更改,包括 9659 次插入1862 次删除
  1. 47 2
      wispro.sp.api/Controllers/PerformanceItemController.cs
  2. 1 1
      wispro.sp.api/Controllers/StaffGradeController.cs
  3. 1 1
      wispro.sp.api/Controllers/VerifyCoefficientController.cs
  4. 1 1
      wispro.sp.api/Controllers/WorkflowEngineController.cs
  5. 二進制
      wispro.sp.api/Development/unsafe_uploads/3zsyyrvx.fms
  6. 二進制
      wispro.sp.api/Development/unsafe_uploads/avzf3xwm.q05
  7. 二進制
      wispro.sp.api/Development/unsafe_uploads/h05esglb.ev1
  8. 二進制
      wispro.sp.api/Development/unsafe_uploads/vjonbppp.0dv
  9. 309 9
      wispro.sp.api/Job/ImportReportJob.cs
  10. 0 1748
      wispro.sp.api/Migrations/20211115011112_addCaseCeoffcient.Designer.cs
  11. 3282 0
      wispro.sp.api/Migrations/20211130020237_sp-database.Designer.cs
  12. 571 32
      wispro.sp.api/Migrations/20211115011112_addCaseCeoffcient.cs
  13. 3332 0
      wispro.sp.api/Migrations/20211130023258_addObjectStaffStatistics.Designer.cs
  14. 55 0
      wispro.sp.api/Migrations/20211130023258_addObjectStaffStatistics.cs
  15. 1587 3
      wispro.sp.api/Migrations/spDbContextModelSnapshot.cs
  16. 127 2
      wispro.sp.api/Utility/Utility.cs
  17. 1 1
      wispro.sp.api/appsettings.json
  18. 149 18
      wispro.sp.api/spDbContext.cs
  19. 1 1
      wispro.sp.utility/IPEasyUtility.cs
  20. 20 0
      wispro.sp.web/Pages/Workflow/WorkflowDefine.razor
  21. 18 0
      wispro.sp.web/Pages/Workflow/WorkflowDefine.razor.cs
  22. 1 1
      wispro.sp.web/Services/PerformanceItemServices.cs
  23. 20 22
      wispro.sp.winClient/Form1.cs
  24. 8 1
      wospro.sp.entity/workflowDefine/Action.cs
  25. 87 0
      wospro.sp.entity/workflowDefine/ConditionTree.cs
  26. 5 0
      wospro.sp.entity/workflowDefine/EnmuFieldType.cs
  27. 7 3
      wospro.sp.entity/workflowDefine/inputValueSetting.cs
  28. 2 2
      wospro.sp.entity/workflowDefine/step.cs
  29. 3 3
      wospro.sp.entity/workflowDefine/trasferCondition.cs
  30. 12 3
      wospro.sp.entity/workflowDefine/workflow.cs
  31. 2 2
      wospro.sp.entity/workflowInstance/Instance.cs
  32. 6 2
      wospro.sp.entity/workflowInstance/stepInputValue.cs
  33. 4 4
      wospro.sp.entity/workflowInstance/stepInstance.cs

+ 47 - 2
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -394,6 +394,17 @@ namespace wispro.sp.api.Controllers
             return d/(double)iCount;
         }
 
+        public List<string> GetFeedbackString(int itemId)
+        {
+            PerformanceItem item = Context.PerformanceItems.FirstOrDefault<PerformanceItem>(p => p.Id == itemId);
+
+            if(item != null)
+            {
+                return Utility.Utility.GetFeedbackMemos(item, Context.BasePointRules.ToList());
+            }
+
+            return new List<string>();
+        }
         private List<StaffStatistics> _CalMyStatistics(CalMonth calMonth, int? userid = null)
         {
             
@@ -633,7 +644,14 @@ namespace wispro.sp.api.Controllers
                 if(calMonth.Status  == 4)
                 {
                     //已归档,归档数据库中直接取出记录
-                    return null;
+                    if (userid == null)
+                    {
+                        return Context.StaffStatistics.Where<StaffStatistics>(s => s.CalMonthId == calMonth.Id).ToList<StaffStatistics>();
+                    }
+                    else
+                    {
+                        return Context.StaffStatistics.Where<StaffStatistics>(s => s.CalMonthId == calMonth.Id && s.StaffId == userid).ToList<StaffStatistics>();
+                    }
                 }
                 else
                 {
@@ -667,6 +685,7 @@ namespace wispro.sp.api.Controllers
 
             return str;
         }
+        
         [HttpPost]
         public ListApiResponse<PerformanceItem> QueryFilter(QueryFilter queryFilter)
         {
@@ -695,6 +714,8 @@ namespace wispro.sp.api.Controllers
                 }
             }
 
+            
+
             var interpreter = new Interpreter();
             Expression<Func<PerformanceItem, bool>> dynamicWhere = interpreter.ParseAsExpression<Func<PerformanceItem, bool>>(strExpress, "s");
 
@@ -772,7 +793,6 @@ namespace wispro.sp.api.Controllers
 
             return ret;
         }
-
         
         public ApiSaveResponse AddProjectPerformance(ProjectPointRecord pointRecord)
         {
@@ -844,5 +864,30 @@ namespace wispro.sp.api.Controllers
 
             return retResponse;
         }
+
+        public PerformanceItem GetCaseInfo(string CaseNo)
+        {
+            var retObj = Context.PerformanceItems.OrderByDescending(p=>p.CalMonthId).FirstOrDefault<PerformanceItem>(p=>p.CaseNo == CaseNo.Trim());
+
+            if(retObj == null)
+            {
+                retObj = new IPEasyController(Context).GetCaseInfo(CaseNo);
+            }
+
+            return retObj;
+            
+        }
+
+        public PerformanceItem GetItemInfo(string CaseNo, string DoItem)
+        {
+            var retObj = Context.PerformanceItems.FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim() && p.DoItem == DoItem.Trim());
+
+            if (retObj == null)
+            {
+                retObj = new IPEasyController(Context).GetItemInfo(CaseNo,DoItem);
+            }
+
+            return retObj;
+        }
     }
 }

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

@@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
 
 namespace wispro.sp.api.Controllers
 {
-    [Authorize]
+    //[Authorize]
     [Route("api/[controller]/[action]")]
     [ApiController]
     public class StaffGradeController : ControllerBase

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

@@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
 
 namespace wispro.sp.api.Controllers
 {
-    [Authorize]
+    //[Authorize]
     [Route("api/[controller]")]
     [ApiController]
     public class VerifyCoefficientController : ControllerBase

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

@@ -12,7 +12,7 @@ namespace wispro.sp.api.Controllers
     [ApiController]
     public class WorkflowEngineController : ControllerBase
     {
-        public void DoAction(int instanceId,int stepId,int ActionId,List<stepInputValue> inputValues)
+        public void DoAction(int instanceId,int stepId,int ActionId,List<InputValue> inputValues)
         {
             //1、取实例对象
 

二進制
wispro.sp.api/Development/unsafe_uploads/3zsyyrvx.fms


二進制
wispro.sp.api/Development/unsafe_uploads/avzf3xwm.q05


二進制
wispro.sp.api/Development/unsafe_uploads/h05esglb.ev1


二進制
wispro.sp.api/Development/unsafe_uploads/vjonbppp.0dv


+ 309 - 9
wispro.sp.api/Job/ImportReportJob.cs

@@ -102,9 +102,11 @@ namespace wispro.sp.api.Job
             
             //每月绩效统计--中国一次OA授权表
             DownloadReport("每月绩效统计--中国一次OA授权表", calMonth, true,true);
+
+            //专案数据
+            DownloadProject(calMonth);
             
-             var lstStaff =   spDb.Staffs.Where<Staff>(s=>s.ItemStaffs.Where<ItemStaff>(p=>p.Item.CalMonthId == calMonth.Id).Count<ItemStaff>()>0);
-                
+            var lstStaff =   spDb.Staffs.Where<Staff>(s=>s.ItemStaffs.Where<ItemStaff>(p=>p.Item.CalMonthId == calMonth.Id).Count<ItemStaff>()>0);
 
             foreach (var staff in lstStaff.ToList<Staff>())
             {
@@ -122,7 +124,22 @@ namespace wispro.sp.api.Job
         {
             string strFileSavePath = utility.ConfigHelper.GetSectionValue("IPEasySetting:DownloadFileSavePath");
 
-            wispro.sp.utility.IPEasyUtility.DownloadReport(ReportName, isModifyDate);
+            int tryCount = 0;
+
+            tryAgain:
+            try
+            {
+                wispro.sp.utility.IPEasyUtility.DownloadReport(ReportName, isModifyDate);
+            }
+            catch {
+                tryCount++;
+
+                if (tryCount < 5)
+                {
+                    goto tryAgain;
+                }
+            }
+
             System.Threading.Thread.Sleep(5000);
             string filename = $"{ReportName.Trim()}.xlsx";
             string strFilePath = System.IO.Path.Combine(strFileSavePath, filename);
@@ -130,15 +147,103 @@ namespace wispro.sp.api.Job
             InputPerformanceItem(strFilePath, true, false, 1, calMonth, isFirstOA);
             System.IO.File.Move(strFilePath, strFinalPath);
         }
-        private void NewMethod(string reportId,string filename, CalMonth calMonth,bool isFirstOA = false)
+
+        private void DownloadProject(CalMonth calMonth)
         {
             string strFileSavePath = utility.ConfigHelper.GetSectionValue("IPEasySetting:DownloadFileSavePath");
+
+            int tryCount = 0;
+
+            string[] ReportNames =new string[] { "每月绩效统计--专案进度跟踪~S卷", "每月绩效统计--专案开卷报表~S卷" };
+
+            List<PerformanceItem> pfItems = new List<PerformanceItem>();
+            foreach (var ReportName in ReportNames)
+            {
+            tryAgain:
+                try
+                {
+                    wispro.sp.utility.IPEasyUtility.DownloadReport(ReportName, false);
+                }
+                catch
+                {
+                    tryCount++;
+
+                    if (tryCount < 5)
+                    {
+                        goto tryAgain;
+                    }
+                }
+
+                System.Threading.Thread.Sleep(5000);
+                string filename = $"{ReportName.Trim().Replace("~","_")}.xlsx";
+                string strFilePath = System.IO.Path.Combine(strFileSavePath, filename);
+                string strFinalPath = System.IO.Path.Combine(strFileSavePath, $"{calMonth.Year}{calMonth.Month}-{filename}");
+
+                var Items = GetProjectItem(strFilePath, calMonth, ReportName.Contains("专案开卷报表"));
+                foreach(var item in Items)
+                {
+                    var temObj = pfItems.FirstOrDefault<PerformanceItem>(s => s.CaseNo == item.CaseNo);
+                    if(temObj == null)
+                    {
+                        item.Type = "专案";
+                        pfItems.Add(item);
+                    }
+                }
+
+                System.IO.File.Move(strFilePath, strFinalPath);
+            }
+            List<BasePointRule> rules = spDb.BasePointRules.ToList<BasePointRule>();
+            foreach (var item in pfItems)
+            {
+                SavePerformanceItem(item, rules);
+            }
+
+        }
+
+        private List<PerformanceItem> GetProjectItem(string strPath,CalMonth calMonth,bool isOpenSheet)
+        {
+            DataTable dt = NPOIExcel.ExcelToDataTable(strPath, true, true, 1);
+
+            #region 删除重复行
+            DataTable temdt = new DataTable();
+            foreach (DataColumn col in dt.Columns)
+            {
+
+                DataColumn temCol = new DataColumn();
+                temCol.ColumnName = col.ColumnName;
+                temCol.DataType = col.DataType;
+                temCol.Caption = col.Caption;
+
+                temdt.Columns.Add(temCol);
+            }
+
+            new ExcelHelper().MerageDataTable(temdt, dt);
+            #endregion
+
             
-            wispro.sp.utility.IPEasyUtility.DownloadReport(reportId, filename);
-            string strFilePath = System.IO.Path.Combine(strFileSavePath, filename);
-            string strFinalPath = System.IO.Path.Combine(strFileSavePath, $"{calMonth.Year}{calMonth.Month}-{filename}");
-            InputPerformanceItem(strFilePath, true, false, 1, calMonth,isFirstOA);
-            System.IO.File.Move(strFilePath, strFinalPath);
+
+            List<PerformanceItem> Items = new List<PerformanceItem>();
+            int iRow = 0;
+            foreach (DataRow row in temdt.Rows)
+            {
+                string strDebug = $"{++iRow}\t{row["我方文号"]}";
+                PerformanceItem item = null;
+                if (!isOpenSheet)
+                {
+                    item = Row2Item_2(row, calMonth);
+                }
+                else
+                {
+                    item = Row2Item_3(row, calMonth);
+                }
+
+                if (item != null)
+                {
+                    Items.Add(item);
+                }
+            }
+
+            return Items;
         }
 
         private Task InputPerformanceItem(string strExcelFile, bool isColumnName, bool ignorHideRows = false, int ColumnNameRow = 0, CalMonth calMonth = null, bool isFirstOAFile = false)
@@ -216,6 +321,191 @@ namespace wispro.sp.api.Job
             return Task.CompletedTask;
         }
 
+        private PerformanceItem Row2Item_3(DataRow row, CalMonth calMonth)
+        {
+            PerformanceItem item = new PerformanceItem();
+
+            item.CaseNo = row["我方文号"].ToString().Trim();
+            item.CaseName = row["案件名称"].ToString().Trim();
+            item.CaseType = row["案件类型"].ToString().Trim();
+            item.BusinessType = row["业务类型"].ToString().Trim();
+            item.Customer = new Customer();
+            item.Customer.Name = row["客户名称"].ToString().Trim();
+            item.CaseState = row["案件状态"].ToString().Trim();
+
+            DateTime temDate = new DateTime();
+            if (DateTime.TryParse(row["委案日期"].ToString().Trim(), out temDate))
+            {
+                item.EntrustingDate = temDate;
+            }
+
+            
+            string strHandler = "";
+            if (row.Table.Columns.Contains("处理人"))
+            {
+                strHandler = row["处理人"].ToString().Trim();
+            }
+            else
+            {
+                if (row.Table.Columns.Contains("案件处理人"))
+                {
+                    strHandler = row["案件处理人"].ToString().Trim();
+                }
+            }
+
+            string[] temHandlers = strHandler.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+            item.ItemStaffs = new List<ItemStaff>();
+
+            foreach (string name in temHandlers)
+            {
+                ItemStaff itemStaff = new ItemStaff();
+                int? iTem = GetStaff(name);
+                if ((iTem != null))
+                {
+                    //itemStaff.Item = item;
+                    itemStaff.DoPersonId = iTem.Value;
+                    item.ItemStaffs.Add(itemStaff);
+                }
+                else
+                {
+                    itemStaff.DoPerson = new Staff()
+                    {
+                        Name = name,
+                        Account = name,
+                        Password = "12345678",
+                        IsCalPerformsnce = false,
+                        Status = "正式员工",
+                        StaffGradeId = 4
+                    };
+                    item.ItemStaffs.Add(itemStaff);
+                }
+            }
+
+            if (item.ItemStaffs.Count == 0)
+            {
+                System.Diagnostics.Debug.WriteLine($"没有处理人: {item.CaseNo}\t{item.DoItem}");
+            }
+
+            if (row.Table.Columns.Contains("核稿人"))
+            {
+                item.ReviewerId = GetStaff(row["核稿人"].ToString().Trim());
+            }
+            else
+            {
+                if (row.Table.Columns.Contains("案件核稿人"))
+                {
+                    item.ReviewerId = GetStaff(row["案件核稿人"].ToString().Trim());
+                }
+            }
+
+            return item;
+        }
+        private PerformanceItem Row2Item_2(DataRow row, CalMonth calMonth)
+        {
+            PerformanceItem item = new PerformanceItem();
+
+            item.CaseNo = row["我方文号"].ToString().Trim();
+            item.CaseName= row["案件名称"].ToString().Trim();
+            item.CaseType = row["案件类型"].ToString().Trim();
+            item.BusinessType= row["业务类型"].ToString().Trim();
+            item.Customer = new Customer();
+            item.Customer.Name = row["客户名称"].ToString().Trim();
+            item.CaseState = row["案件状态"].ToString().Trim();
+            item.DoItem = row["处理事项"].ToString().Trim();
+
+            DateTime temDate = new DateTime();
+            if (DateTime.TryParse(row["内部期限"].ToString().Trim(), out temDate))
+            {
+                item.InternalDate  = temDate;
+            }
+
+            if (DateTime.TryParse(row["客户期限"].ToString().Trim(), out temDate))
+            {
+                item.CustomerLimitDate = temDate;
+            }
+
+            if (DateTime.TryParse(row["初稿日"].ToString().Trim(), out temDate))
+            {
+                item.FirstDraftDate  = temDate;
+            }
+
+            if (DateTime.TryParse(row["定稿日"].ToString().Trim(), out temDate))
+            {
+                item.FinalizationDate = temDate;
+            }
+
+            if (DateTime.TryParse(row["委案日期"].ToString().Trim(), out temDate))
+            {
+                item.EntrustingDate = temDate;
+            }
+
+            if (DateTime.TryParse(row["处理事项完成日"].ToString().Trim(), out temDate))
+            {
+                item.FinishedDate = temDate;
+            }
+
+            item.DoItemState = row["处理状态"].ToString().Trim();
+
+            string strHandler = "";
+            if (row.Table.Columns.Contains("处理人"))
+            {
+                strHandler = row["处理人"].ToString().Trim();
+            }
+            else
+            {
+                if (row.Table.Columns.Contains("案件处理人"))
+                {
+                    strHandler = row["案件处理人"].ToString().Trim();
+                }
+            }
+
+            string[] temHandlers = strHandler.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+            item.ItemStaffs = new List<ItemStaff>();
+
+            foreach (string name in temHandlers)
+            {
+                ItemStaff itemStaff = new ItemStaff();
+                int? iTem = GetStaff(name);
+                if ((iTem != null))
+                {
+                    //itemStaff.Item = item;
+                    itemStaff.DoPersonId = iTem.Value;
+                    item.ItemStaffs.Add(itemStaff);
+                }
+                else
+                {
+                    itemStaff.DoPerson = new Staff()
+                    {
+                        Name = name,
+                        Account = name,
+                        Password = "12345678",
+                        IsCalPerformsnce = false,
+                        Status = "正式员工",
+                        StaffGradeId = 4
+                    };
+                    item.ItemStaffs.Add(itemStaff);
+                }
+            }
+
+            if (item.ItemStaffs.Count == 0)
+            {
+                System.Diagnostics.Debug.WriteLine($"没有处理人: {item.CaseNo}\t{item.DoItem}");
+            }
+
+            if (row.Table.Columns.Contains("核稿人"))
+            {
+                item.ReviewerId = GetStaff(row["核稿人"].ToString().Trim());
+            }
+            else
+            {
+                if (row.Table.Columns.Contains("案件核稿人"))
+                {
+                    item.ReviewerId = GetStaff(row["案件核稿人"].ToString().Trim());
+                }
+            }
+
+            return item;
+        }
         private PerformanceItem Row2Item_1(DataRow row,  CalMonth calMonth)
         {
             PerformanceItem item = new PerformanceItem();
@@ -226,6 +516,11 @@ namespace wispro.sp.api.Job
                 return null;
             }
 
+            if (item.CaseNo.StartsWith("S"))
+            {
+                return null;
+            }
+
             item.CaseNo = row["我方文号"].ToString().Trim();
 
             if (calMonth != null)
@@ -330,6 +625,11 @@ namespace wispro.sp.api.Job
             PerformanceItem item = new PerformanceItem();
             item.CaseNo = row["我方文号"].ToString().Trim();
 
+            if (item.CaseNo.StartsWith("S"))
+            {
+                return null;
+            }
+
             if (calMonth != null)
             {
                 item.CalMonth = calMonth;

文件差異過大導致無法顯示
+ 0 - 1748
wispro.sp.api/Migrations/20211115011112_addCaseCeoffcient.Designer.cs


文件差異過大導致無法顯示
+ 3282 - 0
wispro.sp.api/Migrations/20211130020237_sp-database.Designer.cs


+ 571 - 32
wispro.sp.api/Migrations/20211115011112_addCaseCeoffcient.cs

@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
 
 namespace wispro.sp.api.Migrations
 {
-    public partial class addCaseCeoffcient : Migration
+    public partial class spdatabase : Migration
     {
         protected override void Up(MigrationBuilder migrationBuilder)
         {
@@ -67,6 +67,37 @@ namespace wispro.sp.api.Migrations
                 });
 
             migrationBuilder.CreateTable(
+                name: "Department",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ancestors = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    order_num = table.Column<int>(type: "int", nullable: true),
+                    Memo = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    parentId = table.Column<int>(type: "int", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Department", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Position",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Memo = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Position", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
                 name: "StaffGrade",
                 columns: table => new
                 {
@@ -93,7 +124,8 @@ namespace wispro.sp.api.Migrations
                     AppealTypeId = table.Column<int>(type: "int", nullable: false),
                     AppealState = table.Column<int>(type: "int", nullable: false),
                     CanMuliSelect = table.Column<bool>(type: "bit", nullable: false),
-                    MaxSize = table.Column<int>(type: "int", nullable: true)
+                    MaxSize = table.Column<int>(type: "int", nullable: true),
+                    MapSaveCondition = table.Column<string>(type: "nvarchar(max)", nullable: true)
                 },
                 constraints: table =>
                 {
@@ -208,6 +240,39 @@ namespace wispro.sp.api.Migrations
                 });
 
             migrationBuilder.CreateTable(
+                name: "DepartmentPosition",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    departmentId = table.Column<int>(type: "int", nullable: false),
+                    PositionId = table.Column<int>(type: "int", nullable: false),
+                    StaffId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_DepartmentPosition", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_DepartmentPosition_Department_departmentId",
+                        column: x => x.departmentId,
+                        principalTable: "Department",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_DepartmentPosition_Position_PositionId",
+                        column: x => x.PositionId,
+                        principalTable: "Position",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_DepartmentPosition_Staff_StaffId",
+                        column: x => x.StaffId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
                 name: "Message",
                 columns: table => new
                 {
@@ -426,7 +491,7 @@ namespace wispro.sp.api.Migrations
                     Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                     Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                     SavePath = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
-                    UploadUserId = table.Column<int>(type: "int", nullable: false),
+                    UploadUserId = table.Column<int>(type: "int", nullable: true),
                     AppealRecordId = table.Column<int>(type: "int", nullable: true)
                 },
                 constraints: table =>
@@ -474,6 +539,189 @@ namespace wispro.sp.api.Migrations
                         onDelete: ReferentialAction.Cascade);
                 });
 
+            migrationBuilder.CreateTable(
+                name: "InputValueSetting",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    DisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    valueType = table.Column<int>(type: "int", nullable: false),
+                    bindField = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    bindFieldSavetoObjectCondition = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    actionId = table.Column<int>(type: "int", nullable: false),
+                    Options = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ParentSettingId = table.Column<int>(type: "int", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_InputValueSetting", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_InputValueSetting_InputValueSetting_ParentSettingId",
+                        column: x => x.ParentSettingId,
+                        principalTable: "InputValueSetting",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Workflow",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ContentObjectType = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    InitActionId = table.Column<int>(type: "int", nullable: false),
+                    EndStepId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Workflow", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Step",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    workflowId = table.Column<int>(type: "int", nullable: false),
+                    stepType = table.Column<int>(type: "int", nullable: false),
+                    defaultResponseSetting = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Step", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Step_Workflow_workflowId",
+                        column: x => x.workflowId,
+                        principalTable: "Workflow",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "WorkflowInstance",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    workflowId = table.Column<int>(type: "int", nullable: false),
+                    ObjectId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_WorkflowInstance", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_WorkflowInstance_Workflow_workflowId",
+                        column: x => x.workflowId,
+                        principalTable: "Workflow",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Action",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    InputForm = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    StepId = table.Column<int>(type: "int", nullable: false),
+                    OnActionObjectType = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Action", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Action_Step_StepId",
+                        column: x => x.StepId,
+                        principalTable: "Step",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "TrasferCondition",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    StepId = table.Column<int>(type: "int", nullable: false),
+                    Condition = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    nextStepId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_TrasferCondition", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_TrasferCondition_Step_nextStepId",
+                        column: x => x.nextStepId,
+                        principalTable: "Step",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_TrasferCondition_Step_StepId",
+                        column: x => x.StepId,
+                        principalTable: "Step",
+                        principalColumn: "Id");
+                });
+
+            migrationBuilder.CreateTable(
+                name: "InputValue",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    valueSettingId = table.Column<int>(type: "int", nullable: false),
+                    value = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    workflowInstanceId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_InputValue", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_InputValue_InputValueSetting_valueSettingId",
+                        column: x => x.valueSettingId,
+                        principalTable: "InputValueSetting",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_InputValue_WorkflowInstance_workflowInstanceId",
+                        column: x => x.workflowInstanceId,
+                        principalTable: "WorkflowInstance",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "StepInstance",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    stepId = table.Column<int>(type: "int", nullable: false),
+                    workflowInstanceId = table.Column<int>(type: "int", nullable: false),
+                    PreviousStepId = table.Column<int>(type: "int", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_StepInstance", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_StepInstance_Step_stepId",
+                        column: x => x.stepId,
+                        principalTable: "Step",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_StepInstance_WorkflowInstance_workflowInstanceId",
+                        column: x => x.workflowInstanceId,
+                        principalTable: "WorkflowInstance",
+                        principalColumn: "Id");
+                });
+
             migrationBuilder.InsertData(
                 table: "AppealType",
                 columns: new[] { "Id", "CanDoExpress", "Name", "ReviewerExpress", "Type" },
@@ -488,15 +736,180 @@ namespace wispro.sp.api.Migrations
                 });
 
             migrationBuilder.InsertData(
+                table: "BasePointRule",
+                columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
+                values: new object[,]
+                {
+                    { 90, "0.2", 47, "p.DoItem==\"Non Final Action\" && p.DoItemCoefficient==\"形式\"", "OA" },
+                    { 91, "1.5", 46, "p.DoItem==\"Non Final Action\" && p.DoItemCoefficient==\"实质\"", "OA" },
+                    { 92, "0.1", 45, "p.DoItem==\"form 3-8(2)\" || p.DoItem==\"Form 3-8(2)\" || p.DoItem==\"Form 3-8(2)\"", "OA" },
+                    { 93, "0.1", 44, "p.DoItem==\"form 3\"", "OA" },
+                    { 94, "0.2", 43, "p.DoItem==\"Final Action\" && p.DoItemCoefficient==\"形式\"", "OA" },
+                    { 95, "1.5", 42, "p.DoItem==\"Final Action\" && p.DoItemCoefficient==\"实质\"", "OA" },
+                    { 98, "p.WordCount/1000*0.18", 39, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"中-德\" && p.WordCount !=null", "其它" },
+                    { 97, "1.5", 40, "p.DoItem==\"Advisory Action\" && p.DoItemCoefficient==\"实质\"", "OA" },
+                    { 89, "1.5", 48, "p.DoItem==\"RCE\" && p.DoItemCoefficient==\"实质\"", "OA" },
+                    { 99, "p.WordCount/1000*0.16", 38, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"中-英\" && p.WordCount !=null", "其它" },
+                    { 100, "p.WordCount/1000*0.1", 37, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"英-中\" && p.WordCount !=null", "其它" },
+                    { 101, "0", 36, "(p.ApplicationType==\"实用新型\" || p.ApplicationType==\"发明\") && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"客户不进行答辩\"", "其它" },
+                    { 102, "1.26", 35, "p.CaseNo.StartsWith(\"PAUS\")  && p.AgentFeedbackMemo==\"发文后客户原因取消申请,系统结案\"", "新申请" },
+                    { 96, "0.2", 41, "p.DoItem==\"Advisory Action\" && p.DoItemCoefficient==\"形式\"", "OA" },
+                    { 88, "0.2", 49, "p.DoItem==\"RCE\" && p.DoItemCoefficient==\"形式\"", "OA" },
+                    { 85, "0.2", 52, "p.DoItem==\"口审评估\" && p.DoItemCoefficient==\"形式\"", "OA" },
+                    { 86, "0.2", 51, "p.DoItem==\"欧洲案答辩\" && p.DoItemCoefficient==\"形式\"", "OA" },
+                    { 71, "0.5", 66, "p.DoItem==\"申復\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PATW\")", "OA" },
+                    { 72, "0.2", 65, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAIN\")", "OA" },
+                    { 73, "0.2", 64, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAGB\")", "OA" },
+                    { 74, "0.2", 63, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAEPO\")", "OA" },
+                    { 75, "0.3", 62, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PADE\")", "OA" },
+                    { 77, "1.5", 60, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAIN\")", "OA" },
+                    { 87, "1.5", 50, "p.DoItem==\"欧洲案答辩\" && p.DoItemCoefficient==\"实质\"", "OA" },
+                    { 78, "1.5", 59, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAGB\")", "OA" },
+                    { 80, "1.6", 57, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PADE\")", "OA" },
+                    { 81, "1.5", 56, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAAU\")", "OA" },
+                    { 82, "0.2", 55, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAUS\")", "OA" },
+                    { 83, "1.5", 54, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAUS\")", "OA" },
+                    { 84, "1.5", 53, "p.DoItem==\"口审评估\" && p.DoItemCoefficient==\"实质\"", "OA" },
+                    { 103, "1.33", 34, "p.CaseNo.StartsWith(\"PADE\")  && p.AgentFeedbackMemo==\"发文后客户原因取消申请,系统结案\"", "新申请" },
+                    { 79, "1.5", 58, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAEPO\")", "OA" },
+                    { 104, "0.7", 33, "p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"发文后客户取消申请\"", "新申请" },
+                    { 107, "1.5", 30, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PCTCN\") && p.AgentFeedbackMemo==\"外到内首次申请\"", "新申请" },
+                    { 106, "0", 31, "p.AgentFeedbackMemo==\"撰写中客户取消申请\"", "其它" },
+                    { 137, "0", 250, "p.CaseNo.StartsWith(\"S\")", "专案" }
+                });
+
+            migrationBuilder.InsertData(
+                table: "BasePointRule",
+                columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
+                values: new object[,]
+                {
+                    { 136, "1", 1, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\")", "新申请" },
+                    { 135, "1", 2, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-TS\")", "新申请" },
+                    { 134, "0.7", 3, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" &&  p.CaseNo.StartsWith(\"PACN\")", "新申请" },
+                    { 133, "1", 4, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" &&  p.CaseNo.StartsWith(\"PACN\") && (p.Customer!=null && p.Customer.Name.Contains(\"OPPO\"))", "新申请" },
+                    { 132, "0.1", 5, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" &&  p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-TS\")", "其它" },
+                    { 131, "1.9", 6, "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PADE\")", "新申请" },
+                    { 130, "0.2", 7, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAEPO\")", "其它" },
+                    { 129, "1.8", 8, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAGB\")", "新申请" },
+                    { 128, "1.8", 9, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAUS\")", "新申请" },
+                    { 127, "1.7", 10, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAUS\") && (p.Customer!=null && p.Customer.Name.Contains(\"OPPO\"))", "新申请" },
+                    { 126, "0.1", 11, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\"  && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"", "其它" },
+                    { 125, "0.7", 12, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"", "新申请" },
+                    { 124, "0.1", 13, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"", "其它" },
+                    { 123, "0.2", 14, "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"台湾案转大陆案\"", "其它" },
+                    { 122, "1", 15, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\"  && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"", "新申请" },
+                    { 121, "0.2", 16, "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"大陆案转台湾案\"", "其它" },
+                    { 70, "0.2", 67, "p.DoItem==\"申復\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PATW\")", "OA" },
+                    { 108, "0.1", 29, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"转格式\"", "其它" },
+                    { 109, "1.5", 28, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"外-内首次申请\"", "新申请" },
+                    { 110, "1", 27, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"首次中文案\"", "新申请" },
+                    { 111, "0.7", 26, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"涉外实质改权\"", "新申请" },
+                    { 112, "0.5", 25, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"改权+改说明书\"", "其它" },
+                    { 105, "0.49", 32, "p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"发文后客户取消申请\"", "新申请" },
+                    { 113, "0.3", 24, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"改权\"", "其它" },
+                    { 115, "0.2", 22, "p.AgentFeedbackMemo==\"我方转格式、复核\"", "其它" },
+                    { 116, "0", 21, "p.AgentFeedbackMemo==\"我方代交\"", "其它" },
+                    { 117, "0.5", 20, "p.CaseNo.StartsWith(\"PAUS\") && (p.CaseNo.EndsWith(\"-同套\") || p.CaseNo.EndsWith(\"CA\") || p.CaseNo.EndsWith(\"CIP\") || p.CaseNo.EndsWith(\"分案\")) ", "其它" },
+                    { 118, "0.2", 19, "(p.CaseNo.StartsWith(\"PAMY \") || p.CaseNo.StartsWith(\"PADE\") || p.CaseNo.StartsWith(\"PAGB\") || p.CaseNo.StartsWith(\"PAIN\") || p.CaseNo.StartsWith(\"PAUS\") || p.CaseNo.StartsWith(\"PAEPO\") ) && p.AgentFeedbackMemo==\"同套\"", "其它" },
+                    { 119, "0.3", 18, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-分案\")", "其它" },
+                    { 120, "1.8", 17, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"欧洲案首次\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAEPO\")", "新申请" },
+                    { 114, "1.8", 23, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"PCT首次英文案\"", "新申请" },
+                    { 69, "0.5", 68, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"客户提供答辩点,撰写英文报导函\"", "OA" },
+                    { 76, "0.2", 61, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAAU\")", "OA" },
+                    { 67, "0.1", 70, "p.AgentFeedbackMemo==\"涉外OA不答辩,发报导函结案\"", "其它" },
+                    { 31, "0", 106, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PACN\")", "其它" },
+                    { 30, "0", 107, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PCTCN\")", "其它" },
+                    { 29, "0", 108, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"WOCN\")", "其它" },
+                    { 28, "0.2", 109, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PADE\")", "其它" },
+                    { 27, "0.2", 110, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAEPO\")", "其它" },
+                    { 26, "0.2", 111, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAGB\")", "其它" },
+                    { 25, "0.2", 112, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAIN\")", "其它" },
+                    { 68, "0.8", 69, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"客户未提供答辩点,撰写英文报导函\"", "OA" }
+                });
+
+            migrationBuilder.InsertData(
+                table: "BasePointRule",
+                columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
+                values: new object[,]
+                {
+                    { 23, "0.2", 114, "p.DoItem==\"Election Action\"", "其它" },
+                    { 22, "0.2", 115, "p.DoItem==\"OA答辩校核\"", "其它" },
+                    { 21, "0.1", 116, "p.DoItem==\"PPH\"", "其它" },
+                    { 20, "0", 117, "p.DoItem==\"电询\"  && p.CaseNo.StartsWith(\"PACN\")", "其它" },
+                    { 19, "0.2", 118, "p.DoItem==\"电询\"  && p.CaseNo.StartsWith(\"PAEPO\") ", "其它" },
+                    { 18, "0.2", 119, "p.DoItem==\"电询\"  && p.CaseNo.StartsWith(\"PAUS\")", "其它" },
+                    { 17, "0.1", 120, "p.DoItem==\"分案评估\"", "其它" },
+                    { 16, "0.2", 121, "p.DoItem==\"分案评估+分案\"", "其它" },
+                    { 15, "0", 122, "p.DoItem==\"绘图\"", "其它" },
+                    { 1, "0", 136, "p.CaseNo.StartsWith(\"J\")", "其它" },
+                    { 2, "0", 135, "p.AgentFeedbackMemo==\"已算绩效\"", "其它" },
+                    { 3, "p.WordCount/1000*0.18", 134, "p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"中-德\"", "其它" },
+                    { 4, "p.WordCount/1000*0.16", 133, "p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"中-英\"", "其它" },
+                    { 5, "p.WordCount/1000*0.1", 132, "p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"英-中\"", "其它" },
+                    { 6, "0.2", 131, "(p.DoItem==\"提交检索主题申明\" || p.DoItem==\"提交检索主题声明\") && p.CaseNo.StartsWith(\"PAEPO\")", "其它" },
+                    { 32, "0.2", 105, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAAU\")", "其它" },
+                    { 7, "0", 130, "p.DoItem==\"请求优先审查\"", "其它" },
+                    { 9, "0", 128, "p.DoItem==\"专利挖掘与布局\"", "其它" },
+                    { 10, "0", 127, "p.DoItem==\"知识点总结\"", "其它" },
+                    { 11, "0", 126, "p.DoItem==\"询问放弃或复审\"", "其它" },
+                    { 12, "0", 125, "p.DoItem==\"申请时提交IDS\"", "其它" },
+                    { 13, "0.1", 124, "p.DoItem==\"提交ids\" || p.DoItem==\"提交IDS\" ", "其它" },
+                    { 14, "0", 123, "p.DoItem==\"技术确认\"", "其它" },
+                    { 8, "0.2", 129, "p.ApplicationType==\"外观设计\" && p.DoItem==\"新申请\"", "其它" },
+                    { 33, "0.2", 104, "p.AgentFeedbackMemo==\"检索结案\"", "其它" },
+                    { 24, "0.2", 113, "p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAUS\")", "其它" },
+                    { 35, "0.2", 102, "p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"外-内\"", "其它" },
+                    { 66, "0.5", 71, "p.DoItem==\"请求复审\" && p.ApplicationType==\"发明\"", "OA" },
+                    { 65, "0.2", 72, "p.DoItem==\"意见陈述\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"复审\"", "OA" },
+                    { 64, "0.3", 73, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"非实质\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"一通\"", "OA" },
+                    { 63, "0.5", 74, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PACN\")  && p.CaseStage==\"一通\"", "OA" },
+                    { 62, "0.2", 75, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"一通\"", "OA" },
+                    { 34, "0", 103, "p.DoItem==\"内部检索\"", "其它" },
+                    { 60, "0.5", 77, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PCTCN\")  && p.CaseStage==\"一通\"", "OA" },
+                    { 59, "0.2", 78, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"一通\"", "OA" },
+                    { 58, "0.2", 79, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"二通\"", "OA" },
+                    { 57, "0.2", 80, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"二通\"", "OA" },
+                    { 56, "0", 81, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") &&  (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\")", "OA" },
+                    { 55, "0", 82, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PCTCN\") &&  (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\")", "OA" },
+                    { 54, "0.3", 83, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"非实质\"  && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"", "OA" },
+                    { 53, "0.5", 84, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"", "OA" },
+                    { 52, "0.2", 85, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"", "OA" }
+                });
+
+            migrationBuilder.InsertData(
+                table: "BasePointRule",
+                columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
+                values: new object[,]
+                {
+                    { 61, "0.3", 76, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"非实质\" && p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"一通\"", "OA" },
+                    { 50, "0.14", 87, "p.ApplicationType==\"实用新型\"  && p.DoItemCoefficient==\"实质\" && p.CaseStage==\"二通\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
+                    { 36, "0.3", 101, "p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"内-外\"", "其它" },
+                    { 37, "0.5", 100, "p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"外-内\"", "其它" },
+                    { 38, "0.7", 99, "p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"内-外\"", "其它" },
+                    { 39, "0.2", 98, "p.DoItem==\"发明一次OA授权\" && p.ApplicationType==\"发明\"", "其它" },
+                    { 40, "0", 97, "p.DoItem==\"处理审查意见\" &&  p.AgentFeedbackMemo==\"客户不进行答辩\"", "OA" },
+                    { 41, "0", 96, "p.DoItem==\"处理审查意见\" &&  p.AgentFeedbackMemo==\"电询/补正\"", "OA" },
+                    { 42, "0", 95, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"实用新型\"  && p.AgentFeedbackMemo==\"不请款\"", "OA" },
+                    { 44, "0", 93, "p.DoItem==\"请求复审\" && p.ApplicationType==\"实用新型\"  && p.AgentFeedbackMemo==\"不请款\"", "OA" },
+                    { 45, "0.14", 92, "p.DoItem==\"意见陈述\" && p.ApplicationType==\"实用新型\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
+                    { 46, "0.35", 91, "p.DoItem==\"请求复审\" && p.ApplicationType==\"实用新型\"  && p.AgentFeedbackMemo==\"请款\"", "OA" },
+                    { 47, "0.21", 90, "p.ApplicationType==\"实用新型\"  && p.DoItemCoefficient==\"非实质\" && p.CaseStage==\"一通\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
+                    { 48, "0.35", 89, "p.ApplicationType==\"实用新型\"  && p.DoItemCoefficient==\"实质\" && p.CaseStage==\"一通\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
+                    { 49, "0.14", 88, "p.ApplicationType==\"实用新型\"  && p.DoItemCoefficient==\"形式\" && p.CaseStage==\"一通\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
+                    { 43, "0", 94, "p.DoItem==\"意见陈述\" && p.ApplicationType==\"实用新型\" && p.AgentFeedbackMemo==\"不请款\"", "OA" },
+                    { 51, "0", 86, "p.ApplicationType==\"实用新型\"  && p.DoItemCoefficient==\"实质\" && (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\" || p.CaseStage==\"六通\" || p.CaseStage==\"七通\" || p.CaseStage==\"八通\") ", "OA" }
+                });
+
+            migrationBuilder.InsertData(
                 table: "CaseCeofficient",
                 columns: new[] { "Ceoffcient", "Value" },
                 values: new object[,]
                 {
-                    { "D", 0.40000000000000002 },
                     { "C", 0.69999999999999996 },
+                    { "D", 0.40000000000000002 },
                     { "B", 1.0 },
-                    { "A", 1.5 },
-                    { "S", 2.5 }
+                    { "S", 2.5 },
+                    { "A", 1.5 }
                 });
 
             migrationBuilder.InsertData(
@@ -511,43 +924,43 @@ namespace wispro.sp.api.Migrations
                     { 10, 0.69999999999999996, "C1级" },
                     { 9, 0.69999999999999996, "C2级" },
                     { 8, 0.90000000000000002, "C3级" },
-                    { 3, 1.1000000000000001, "A2级" },
-                    { 6, 1.0, "B2级" },
+                    { 7, 0.90000000000000002, "B1级" },
                     { 5, 1.0, "B3级" },
                     { 4, 1.1000000000000001, "A1级" },
-                    { 15, 1.0, "C级" },
+                    { 3, 1.1000000000000001, "A2级" },
                     { 2, 1.1000000000000001, "A3级" },
                     { 1, 1.2, "S级" },
-                    { 7, 0.90000000000000002, "B1级" },
+                    { 15, 1.0, "C级" },
+                    { 6, 1.0, "B2级" },
                     { 16, 0.90000000000000002, "D级" }
                 });
 
             migrationBuilder.InsertData(
                 table: "InputField",
-                columns: new[] { "Id", "AppealState", "AppealTypeId", "CanMuliSelect", "FieldName", "FieldType", "MapObjectField", "MapObjectFieldLabel", "MaxSize" },
+                columns: new[] { "Id", "AppealState", "AppealTypeId", "CanMuliSelect", "FieldName", "FieldType", "MapObjectField", "MapObjectFieldLabel", "MapSaveCondition", "MaxSize" },
                 values: new object[,]
                 {
-                    { 1, 0, 1, false, "分配比率", "System.Double", "ItemStaffs.PerformancePoint", "ItemStaffs.DoPerson.Name", null },
-                    { 24, 1, 6, false, "翻译字数", "System.Int32", "WordCount", null, null },
-                    { 23, 1, 6, false, "审核意见", "System.Int32", null, null, null },
-                    { 20, 0, 6, false, "翻译字数", "System.Int32", "WordCount", null, null },
-                    { 19, 0, 6, false, "翻译类型", "System.String", "AgentFeedbackMemo", null, null },
-                    { 21, 1, 5, false, "审核意见", "System.String", null, null, null },
-                    { 18, 0, 5, false, "超期说明", "System.String", "OverDueMemo", null, null },
-                    { 17, 1, 4, false, "审核意见", "System.String", null, null, null },
-                    { 16, 1, 4, false, "备注", "System.String", null, null, null },
-                    { 15, 0, 4, false, "处理事项", "System.String", null, null, null },
-                    { 22, 1, 5, false, "备注", "System.String", null, null, null },
-                    { 13, 1, 3, false, "审核意见", "System.String", null, null, null },
-                    { 12, 1, 3, false, "备注", "System.String", null, null, null },
-                    { 11, 0, 3, false, "处理事项系数", "System.String", "DoItemCoefficient", null, null },
-                    { 10, 1, 2, false, "审核意见", "System.String", null, null, null },
-                    { 9, 1, 2, false, "备注", "System.String", null, null, null },
-                    { 6, 0, 2, false, "案件系数", "System.String", "CaseCoefficient", null, null },
-                    { 5, 1, 1, false, "审核意见", "System.String", null, null, null },
-                    { 4, 1, 1, false, "备注", "System.String", null, null, null },
-                    { 3, 0, 1, false, "原因", "System.String", null, null, null },
-                    { 14, 0, 4, false, "我方文号", "System.String", null, null, null }
+                    { 1, 0, 1, false, "分配比率", "System.Double", "ItemStaffs.PerformancePoint", "ItemStaffs.DoPerson.Name", null, null },
+                    { 24, 1, 6, false, "翻译字数", "System.Int32", "WordCount", null, null, null },
+                    { 23, 1, 6, false, "审核意见", "System.Int32", null, null, null, null },
+                    { 20, 0, 6, false, "翻译字数", "System.Int32", "WordCount", null, null, null },
+                    { 19, 0, 6, false, "翻译类型", "System.String", "AgentFeedbackMemo", null, null, null },
+                    { 21, 1, 5, false, "审核意见", "System.String", null, null, null, null },
+                    { 18, 0, 5, false, "超期说明", "System.String", "OverDueMemo", null, null, null },
+                    { 17, 1, 4, false, "审核意见", "System.String", null, null, null, null },
+                    { 16, 1, 4, false, "备注", "System.String", null, null, null, null },
+                    { 15, 0, 4, false, "处理事项", "System.String", null, null, null, null },
+                    { 22, 1, 5, false, "备注", "System.String", null, null, null, null },
+                    { 13, 1, 3, false, "审核意见", "System.String", null, null, null, null },
+                    { 12, 1, 3, false, "备注", "System.String", null, null, null, null },
+                    { 11, 0, 3, false, "处理事项系数", "System.String", "DoItemCoefficient", null, null, null },
+                    { 10, 1, 2, false, "审核意见", "System.String", null, null, null, null },
+                    { 9, 1, 2, false, "备注", "System.String", null, null, null, null },
+                    { 6, 0, 2, false, "案件系数", "System.String", "CaseCoefficient", null, null, null },
+                    { 5, 1, 1, false, "审核意见", "System.String", null, null, null, null },
+                    { 4, 1, 1, false, "备注", "System.String", null, null, null, null },
+                    { 3, 0, 1, false, "原因", "System.String", null, null, null, null },
+                    { 14, 0, 4, false, "我方文号", "System.String", null, null, null, null }
                 });
 
             migrationBuilder.InsertData(
@@ -646,6 +1059,11 @@ namespace wispro.sp.api.Migrations
                 });
 
             migrationBuilder.CreateIndex(
+                name: "IX_Action_StepId",
+                table: "Action",
+                column: "StepId");
+
+            migrationBuilder.CreateIndex(
                 name: "IX_AppealRecord_CreaterId",
                 table: "AppealRecord",
                 column: "CreaterId");
@@ -681,6 +1099,21 @@ namespace wispro.sp.api.Migrations
                 column: "ResponseManId");
 
             migrationBuilder.CreateIndex(
+                name: "IX_DepartmentPosition_departmentId",
+                table: "DepartmentPosition",
+                column: "departmentId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_DepartmentPosition_PositionId",
+                table: "DepartmentPosition",
+                column: "PositionId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_DepartmentPosition_StaffId",
+                table: "DepartmentPosition",
+                column: "StaffId");
+
+            migrationBuilder.CreateIndex(
                 name: "IX_InputField_AppealTypeId",
                 table: "InputField",
                 column: "AppealTypeId");
@@ -696,6 +1129,26 @@ namespace wispro.sp.api.Migrations
                 column: "InputFieldId");
 
             migrationBuilder.CreateIndex(
+                name: "IX_InputValue_valueSettingId",
+                table: "InputValue",
+                column: "valueSettingId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_InputValue_workflowInstanceId",
+                table: "InputValue",
+                column: "workflowInstanceId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_InputValueSetting_actionId",
+                table: "InputValueSetting",
+                column: "actionId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_InputValueSetting_ParentSettingId",
+                table: "InputValueSetting",
+                column: "ParentSettingId");
+
+            migrationBuilder.CreateIndex(
                 name: "IX_ItemStaff_DoPersonId",
                 table: "ItemStaff",
                 column: "DoPersonId");
@@ -751,13 +1204,66 @@ namespace wispro.sp.api.Migrations
                 column: "StaffGradeId");
 
             migrationBuilder.CreateIndex(
+                name: "IX_Step_workflowId",
+                table: "Step",
+                column: "workflowId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_StepInstance_stepId",
+                table: "StepInstance",
+                column: "stepId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_StepInstance_workflowInstanceId",
+                table: "StepInstance",
+                column: "workflowInstanceId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_TrasferCondition_nextStepId",
+                table: "TrasferCondition",
+                column: "nextStepId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_TrasferCondition_StepId",
+                table: "TrasferCondition",
+                column: "StepId");
+
+            migrationBuilder.CreateIndex(
                 name: "IX_VerifyCoefficient_DoPersonId",
                 table: "VerifyCoefficient",
                 column: "DoPersonId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Workflow_InitActionId",
+                table: "Workflow",
+                column: "InitActionId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_WorkflowInstance_workflowId",
+                table: "WorkflowInstance",
+                column: "workflowId");
+
+            migrationBuilder.AddForeignKey(
+                name: "FK_InputValueSetting_Action_actionId",
+                table: "InputValueSetting",
+                column: "actionId",
+                principalTable: "Action",
+                principalColumn: "Id");
+
+            migrationBuilder.AddForeignKey(
+                name: "FK_Workflow_Action_InitActionId",
+                table: "Workflow",
+                column: "InitActionId",
+                principalTable: "Action",
+                principalColumn: "Id");
         }
 
         protected override void Down(MigrationBuilder migrationBuilder)
         {
+            migrationBuilder.DropForeignKey(
+                name: "FK_Action_Step_StepId",
+                table: "Action");
+
             migrationBuilder.DropTable(
                 name: "AttachFile");
 
@@ -768,9 +1274,15 @@ namespace wispro.sp.api.Migrations
                 name: "CaseCeofficient");
 
             migrationBuilder.DropTable(
+                name: "DepartmentPosition");
+
+            migrationBuilder.DropTable(
                 name: "InputFieldValue");
 
             migrationBuilder.DropTable(
+                name: "InputValue");
+
+            migrationBuilder.DropTable(
                 name: "ItemStaff");
 
             migrationBuilder.DropTable(
@@ -783,18 +1295,36 @@ namespace wispro.sp.api.Migrations
                 name: "SelectValue");
 
             migrationBuilder.DropTable(
+                name: "StepInstance");
+
+            migrationBuilder.DropTable(
+                name: "TrasferCondition");
+
+            migrationBuilder.DropTable(
                 name: "VerifyCoefficient");
 
             migrationBuilder.DropTable(
+                name: "Department");
+
+            migrationBuilder.DropTable(
+                name: "Position");
+
+            migrationBuilder.DropTable(
                 name: "AppealRecord");
 
             migrationBuilder.DropTable(
+                name: "InputValueSetting");
+
+            migrationBuilder.DropTable(
                 name: "Message");
 
             migrationBuilder.DropTable(
                 name: "InputField");
 
             migrationBuilder.DropTable(
+                name: "WorkflowInstance");
+
+            migrationBuilder.DropTable(
                 name: "PerformanceItem");
 
             migrationBuilder.DropTable(
@@ -811,6 +1341,15 @@ namespace wispro.sp.api.Migrations
 
             migrationBuilder.DropTable(
                 name: "StaffGrade");
+
+            migrationBuilder.DropTable(
+                name: "Step");
+
+            migrationBuilder.DropTable(
+                name: "Workflow");
+
+            migrationBuilder.DropTable(
+                name: "Action");
         }
     }
 }

文件差異過大導致無法顯示
+ 3332 - 0
wispro.sp.api/Migrations/20211130023258_addObjectStaffStatistics.Designer.cs


+ 55 - 0
wispro.sp.api/Migrations/20211130023258_addObjectStaffStatistics.cs

@@ -0,0 +1,55 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace wispro.sp.api.Migrations
+{
+    public partial class addObjectStaffStatistics : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "StaffStatistics",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    CalMonthId = table.Column<int>(type: "int", nullable: false),
+                    StaffId = table.Column<int>(type: "int", nullable: false),
+                    jxType = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    totalBasePoint = table.Column<double>(type: "float", nullable: true),
+                    totalActuallyPoint = table.Column<double>(type: "float", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_StaffStatistics", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_StaffStatistics_CalMonth_CalMonthId",
+                        column: x => x.CalMonthId,
+                        principalTable: "CalMonth",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_StaffStatistics_Staff_StaffId",
+                        column: x => x.StaffId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_StaffStatistics_CalMonthId",
+                table: "StaffStatistics",
+                column: "CalMonthId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_StaffStatistics_StaffId",
+                table: "StaffStatistics",
+                column: "StaffId");
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "StaffStatistics");
+        }
+    }
+}

文件差異過大導致無法顯示
+ 1587 - 3
wispro.sp.api/Migrations/spDbContextModelSnapshot.cs


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

@@ -2,6 +2,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using wispro.sp.entity;
 
@@ -29,8 +30,13 @@ namespace wispro.sp.api.Utility
 
                 if (result)
                 {
-                    //interpreter.SetVariable("p", item);
-                    item.BasePoint = (double?)interpreter.Eval(rule.PointExpress);
+                    var temString = rule.PointExpress;
+                    if (!rule.PointExpress.Contains("."))
+                    {
+                        temString = $"{rule.PointExpress.Trim()}.0";
+                    }
+
+                    item.BasePoint = (double?)interpreter.Eval(temString);
                     item.Type = rule.Type;
                     break;
                 }
@@ -38,6 +44,125 @@ namespace wispro.sp.api.Utility
             #endregion
         }
 
+        public static List<string> GetDoItemCeofficient(PerformanceItem item, List<BasePointRule> rules)
+        {
+            List<string> retList = new List<string>();
+            foreach (BasePointRule rule in rules)
+            {
+                Regex r = new System.Text.RegularExpressions.Regex("p.DoItemCoefficient\\s{0,}==\\s{0,}\"(.+?)\"");
+
+                Match m = r.Match(rule.Rule);
+
+                if (m.Success)
+                {
+                    string strFeedback = m.Groups[1].Value;
+                    string temRule = rule.Rule.Replace(m.Value, "");
+
+                    if (string.IsNullOrEmpty(temRule.Trim()))
+                    {
+                        continue;
+                    }
+                    else
+                    {
+                        r = new Regex("&&\\s{1,}&&");
+                        m = r.Match(temRule);
+                        if (m.Success)
+                        {
+                            temRule = temRule.Replace(m.Value, "&&");
+                        }
+
+                        if (temRule.Trim().EndsWith("&&"))
+                        {
+                            temRule = temRule.Trim().Substring(0, temRule.Trim().Length - 2).Trim();
+                        }
+
+                        if (temRule.Trim().StartsWith("&&"))
+                        {
+                            temRule = temRule.Substring(2).Trim();
+                        }
+
+                        var interpreter = new Interpreter();
+                        //item.ApplicationType
+                        Func<PerformanceItem, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem, bool>>(temRule, "p");
+
+                        bool result = func.Invoke(item);
+
+                        if (result)
+                        {
+                            if (!retList.Contains(strFeedback))
+                            {
+                                retList.Add(strFeedback);
+                            }
+                        }
+                    }
+                }
+
+            }
+
+            return retList;
+        }
+
+        public  static  List<string> GetFeedbackMemos(PerformanceItem item, List<BasePointRule> rules)
+        {
+            List<string> retList = new List<string>();
+            foreach(BasePointRule rule in rules)
+            {
+                Regex r= new System.Text.RegularExpressions.Regex("p.AgentFeedbackMemo==\"(.+?)\"");
+
+                Match m = r.Match(rule.Rule);
+
+                if (m.Success)
+                {
+                    string strFeedback = m.Groups[1].Value;
+                    string temRule = rule.Rule.Replace(m.Value, "");
+
+                    if (string.IsNullOrEmpty(temRule.Trim()))
+                    {
+                        if (!retList.Contains(strFeedback))
+                        {
+                            retList.Add(strFeedback);
+                        }
+                    }
+                    else
+                    {
+                        r = new Regex("&&\\s{1,}&&");
+                        m = r.Match(temRule);
+                        if (m.Success)
+                        {
+                            temRule = temRule.Replace(m.Value, "&&");
+                        }
+
+                        if (temRule.Trim().EndsWith("&&"))
+                        {
+                            temRule = temRule.Trim().Substring(0, temRule.Trim().Length - 2).Trim();
+                        }
+
+                        if (temRule.Trim().StartsWith("&&"))
+                        {
+                            temRule = temRule.Substring(2).Trim();
+                        }
+
+                        var interpreter = new Interpreter();
+                        //item.ApplicationType
+                        Func<PerformanceItem, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem, bool>>(temRule, "p");
+
+                        bool result = func.Invoke(item);
+
+                        if (result)
+                        {
+                            if (!retList.Contains(strFeedback))
+                            {
+                                retList.Add(strFeedback);
+                            }
+                        }
+                    }
+                }
+
+            }
+
+            return retList;
+        }
+
         
     }
 }

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

@@ -27,7 +27,7 @@
     "Account": "caiyangl",
     "Password": "j)wx*lier*@3",
     "ChormeDriverPath": "D:\\source\\repos\\ConsoleApp2\\ConsoleApp2\\bin\\Debug",
-    "ScheduleSetting": "00 16 01 1 * ? *",
+    "ScheduleSetting": "00 23 18 * * ? *",
     "IPEasyWeb": "http://47.106.221.167/Login.aspx"
   },
 

+ 149 - 18
wispro.sp.api/spDbContext.cs

@@ -4,7 +4,8 @@ using System.Collections.Generic;
 using System.Configuration;
 using System.Data;
 using wispro.sp.entity;
-
+using wispro.sp.entity.workflowDefine;
+using wispro.sp.entity.workflowInstance;
 
 namespace wispro.sp.api
 {
@@ -37,6 +38,8 @@ namespace wispro.sp.api
 
         public virtual DbSet<BasePointRule> BasePointRules { get; set; }
 
+        public virtual DbSet<StaffStatistics> StaffStatistics { get; set; }
+
         public virtual DbSet<InputField> InputFields { get; set; }
 
         public virtual DbSet<InputFieldValue> InputFieldValues { get; set; }
@@ -53,6 +56,25 @@ namespace wispro.sp.api
 
         public virtual DbSet<Position> Positions { get; set; }
 
+        #region 流程定义
+        public virtual DbSet<Workflow> Wrokflows { get; set; }
+
+        public virtual DbSet<Step> Steps { get; set; }
+
+        public virtual DbSet<TrasferCondition> TrasferConditions { get; set; }
+
+        public virtual DbSet<Action> Actions { get; set; }
+
+        public virtual DbSet<InputValueSetting> InputValueSettings { get; set; }
+
+        public virtual DbSet<WorkflowInstance> WorkflowInstances { get; set; }
+
+        public virtual DbSet<InputValue> InputValues { get; set; }
+
+        public virtual DbSet<StepInstance> StepInstances { get; set; }
+        
+        #endregion
+
         public virtual DbSet<DepartmentPosition> DepartmentPositions { get; set; }
 
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
@@ -272,6 +294,20 @@ namespace wispro.sp.api
                     .HasConstraintName("FK_Staff_StaffGrade");
             });
 
+
+            modelBuilder.Entity<StaffStatistics>(entity =>
+            {
+                entity.ToTable("StaffStatistics");
+
+                entity.HasOne(d => d.CalMonth)
+                    .WithMany()
+                    .HasForeignKey(d=>d.CalMonthId);
+
+                entity.HasOne(d => d.Staff)
+                    .WithMany()
+                    .HasForeignKey(d => d.StaffId);
+            });
+
             modelBuilder.Entity<Message>(entity =>
             {
                 //entity.HasKey(e => e.Id);
@@ -538,28 +574,30 @@ namespace wispro.sp.api
                 );
 
             #region 初始化绩效点数规则
-            //List<BasePointRule> rules = new List<BasePointRule>();
-            //DataTable dt = wispro.sp.utility.NPOIExcel.ExcelToDataTable("ExcelFiles\\20211109-绩效点数规则-lcy-v1.xlsx", true);
+            List<BasePointRule> rules = new List<BasePointRule>();
+            DataTable dt = wispro.sp.utility.NPOIExcel.ExcelToDataTable("c:\\temp\\20211130-点数规则-lcy-v1.xlsx", true);
+
+            foreach (DataRow row in dt.Rows)
+            {
+                BasePointRule rule = new BasePointRule()
+                {
+                    Rule = row["规则"].ToString(),
+                    PointExpress = row["点数计算"].ToString(),
+                    Priority = int.Parse(row["优先级修订"].ToString()),
+                    Type = row["类型"].ToString()
 
-            //foreach (DataRow row in dt.Rows)
-            //{
-            //    BasePointRule rule = new BasePointRule()
-            //    {
-            //        Rule = row["规则"].ToString(),
-            //        PointExpress = row["点数计算"].ToString(),
-            //        Priority = int.Parse(row["优先级修订"].ToString()),
-            //        Type = row["类型"].ToString()
+                };
 
-            //    };
-            //}
+                rules.Add(rule);
+            }
 
-            //for (int i = 0; i < rules.Count; i++)
-            //{
-            //    rules[i].Id = i + 1;
-            //}
+            for (int i = 0; i < rules.Count; i++)
+            {
+                rules[i].Id = i + 1;
+            }
 
 
-            //modelBuilder.Entity<BasePointRule>().HasData(rules);
+            modelBuilder.Entity<BasePointRule>().HasData(rules);
             #endregion
 
             AppealType[] appealTypes = new AppealType[]
@@ -648,6 +686,99 @@ namespace wispro.sp.api
             modelBuilder.Entity<SelectValue>().HasData(selectValues);
             modelBuilder.Entity<CaseCeoffcient>().HasData(caseCeoffcients);
 
+            #region 流程定义
+
+            modelBuilder.Entity<Workflow>(entity => {
+                entity.ToTable("Workflow");
+
+                entity.HasOne(d => d.InitAction)
+                    .WithMany()
+                    .HasForeignKey(d => d.InitActionId)
+                    .OnDelete(DeleteBehavior.NoAction);
+
+                entity.HasOne(d => d.CreateUser)
+                    .WithMany()
+                    .HasForeignKey(d=>d.CreateUserId);
+            });
+
+            modelBuilder.Entity<Step>(entity => {
+                entity.ToTable("Step");
+
+                entity.HasOne(d => d.workflow)
+                    .WithMany()
+                    .HasForeignKey(d => d.workflowId);
+            });
+
+            modelBuilder.Entity<TrasferCondition>(entity=> {
+                entity.ToTable("TrasferCondition");
+
+                entity.HasOne(d=>d.Step)
+                    .WithMany()
+                    .HasForeignKey(d=>d.StepId)
+                    .OnDelete(DeleteBehavior.NoAction);
+
+                entity.HasOne(d => d.nextStep)
+                    .WithMany()
+                    .HasForeignKey(d => d.nextStepId)
+                    .OnDelete(DeleteBehavior.NoAction);
+            });
+
+            modelBuilder.Entity<Action>(entity => {
+                entity.ToTable("Action");
+
+                entity.HasOne(d => d.step)
+                    .WithMany()
+                    .HasForeignKey(d => d.StepId);
+            });
+
+            modelBuilder.Entity<InputValueSetting>(entity => {
+                entity.ToTable("InputValueSetting");
+
+                entity.HasOne(d => d.action)
+                    .WithMany(d=>d.inputValuesSettings)
+                    .HasForeignKey(d => d.actionId)
+                    .OnDelete(DeleteBehavior.NoAction);
+
+                entity.HasOne(d => d.ParentSetting)
+                    .WithMany()
+                    .HasForeignKey(d => d.ParentSettingId);
+            });
+
+            modelBuilder.Entity<WorkflowInstance>(entity=> {
+                entity.ToTable("WorkflowInstance");
+
+                entity.HasOne(d=>d.workflow)
+                    .WithMany()
+                    .HasForeignKey(d=>d.workflowId);
+            });
+
+            modelBuilder.Entity<StepInstance>(entity => {
+                entity.ToTable("StepInstance");
+
+                entity.HasOne(d => d.Step)
+                    .WithMany()
+                    .HasForeignKey(d => d.stepId);
+
+                entity.HasOne(d => d.workflowInstance)
+                    .WithMany()
+                    .HasForeignKey(d => d.workflowInstanceId)
+                    .OnDelete(DeleteBehavior.NoAction);
+            });
+
+            modelBuilder.Entity<InputValue>(entity => {
+                entity.ToTable("InputValue");
+
+                entity.HasOne(d => d.workflowInstance)
+                    .WithMany()
+                    .HasForeignKey(d => d.workflowInstanceId);
+
+                entity.HasOne(d => d.valueSetting)
+                    .WithMany()
+                    .HasForeignKey(d => d.valueSettingId);
+            });
+
+            #endregion
+
             OnModelCreatingPartial(modelBuilder);
         }
 

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

@@ -191,7 +191,7 @@ namespace wispro.sp.utility
                 while (true)
                 {
 
-                    System.IO.FileInfo file = new System.IO.FileInfo(strFilePath);
+                    System.IO.FileInfo file = new System.IO.FileInfo(strFilePath.Replace("~","_"));
                     if (!file.Exists || file.Length == 0)
                     {
                         System.Threading.Thread.Sleep(5000);

+ 20 - 0
wispro.sp.web/Pages/Workflow/WorkflowDefine.razor

@@ -0,0 +1,20 @@
+<PageContainer>
+    <Breadcrumb>
+        <Breadcrumb>
+            <BreadcrumbItem>
+                <a href="/Home"><Icon Type="home"></Icon></a>
+            </BreadcrumbItem>
+            <BreadcrumbItem>
+                <Icon Type="setting"></Icon><span>基本信息管理</span>
+            </BreadcrumbItem>
+            <BreadcrumbItem>
+                <Icon Type="user"></Icon><span>账号管理</span>
+            </BreadcrumbItem>
+        </Breadcrumb>
+    </Breadcrumb>
+    <Content>
+        <Button Type="primary" Icon="plus" OnClick="AddNew" Style="float:right">添加</Button>
+    </Content>
+    <ChildContent>
+    </ChildContent>
+</PageContainer>

+ 18 - 0
wispro.sp.web/Pages/Workflow/WorkflowDefine.razor.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace wispro.sp.web.Pages.Workflow
+{
+    public partial class WorkflowDefine
+    {
+        private List<wispro.sp.entity.workflowDefine.Workflow> workflows = new List<wispro.sp.entity.workflowDefine.Workflow>();
+        protected override async System.Threading.Tasks.Task OnInitializedAsync()
+        {
+            await base.OnInitializedAsync();
+        }
+
+
+    }
+}

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

@@ -133,7 +133,7 @@ namespace wispro.sp.web.Services
 
         public async  Task<PerformanceItem> GetProjectInfo(string caseNo)
         {
-            var data = await _httpClient.Get<PerformanceItem>($"IPEasy/GetCaseInfo?CaseNo={caseNo}");
+            var data = await _httpClient.Get<PerformanceItem>($"PerformanctItem/GetCaseInfo?CaseNo={caseNo}");
             return data;
         }
 

+ 20 - 22
wispro.sp.winClient/Form1.cs

@@ -173,28 +173,28 @@ namespace wispro.sp.winClient
 
         private async void button3_Click(object sender, EventArgs e)
         {
-            dynamic dynObj = new ExpandoObject();
-            dynObj.Name = "名称";
-            dynObj.Text = "aaabc";
-            
+            //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);
+            //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);
+            //}
 
-            var dynamic = System.Text.Json.JsonSerializer.Deserialize<ExpandoObject>(temTxt);
-            
+            //dynObj.List = list;
+            //var temTxt = System.Text.Json.JsonSerializer.Serialize(dynObj);
 
-            MessageBox.Show(((IDictionary<string, object>)dynamic)["Name"].ToString());
+            //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();
@@ -211,8 +211,8 @@ namespace wispro.sp.winClient
 
             ////return;
 
-            //await ImportUsers();
-            //await InputPerformanceItem("ExcelFiles\\21.01-21.06 工程师绩效报表-总表.xlsx", true, false, 0);
+            await ImportUsers();
+            await InputPerformanceItem("ExcelFiles\\21.01-21.06 工程师绩效报表-总表.xlsx", true, false, 0);
 
             ////CalMonth cal = new CalMonth()
             ////{
@@ -623,8 +623,6 @@ namespace wispro.sp.winClient
                 //staff.StaffGradeId = row["姓名"].ToString();
 
                 await SaveStaff(staff);
-
-
             }
         }
 

+ 8 - 1
wospro.sp.entity/workflowDefine/Action.cs

@@ -21,7 +21,7 @@ namespace wispro.sp.entity.workflowDefine
         /// <summary>
         /// 输入输入设定
         /// </summary>
-        public List<inputValueSetting> inputValuesSettings { get; set; }
+        public List<InputValueSetting> inputValuesSettings { get; set; }
 
         /// <summary>
         /// 操作界面
@@ -33,6 +33,13 @@ namespace wispro.sp.entity.workflowDefine
         /// </summary>
         public int StepId { get; set; }
 
+        public Step step { get; set; }
+
+        /// <summary>
+        /// 完成操作时调用的对象类型
+        /// </summary>
+        public String OnActionObjectType { get; set; }
+
 
 
     }

+ 87 - 0
wospro.sp.entity/workflowDefine/ConditionTree.cs

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity.workflowDefine
+{
+    public class ConditionExpress
+    {
+        public ConditionTreeNode Root { get; set; }
+
+        public void AddCondition(ConditionExpress express ,LogicSymbols logic)
+        {
+            if(express.Root != null)
+            {
+                if (Root != null)
+                {
+                    ConditionTreeNode node = new LogicNode() { operate = logic };
+                    node.Left = Root;
+                    node.Right = express.Root;
+                    Root = node;
+                }
+                else
+                {
+                    Root = express.Root;
+                }
+            }
+        }
+    }
+
+    public class ConditionTreeNode
+    {
+        public ConditionTreeNode Right { get; set; }
+
+        public ConditionTreeNode Left { get; set; }
+    }
+
+    public enum LogicSymbols
+    {
+        AND,
+        OR,
+        NOT
+    }
+
+    public enum ComparisonSymbol
+    {
+        Contains,
+        Equal,
+        Greater,
+        GreaterEqual,
+        Less,
+        LessEqual,
+        NotEqual,
+        In,
+        Between,
+        StartsWith,
+        EndWith,
+        NotContains
+    }
+
+    public class LogicNode : ConditionTreeNode
+    {
+        public LogicSymbols operate { get; set; }
+    }
+
+    public class FieldNode : ConditionTreeNode
+    {
+        /// <summary>
+        /// 字段名称
+        /// </summary>
+        public string FieldName { get; set; }
+        /// <summary>
+        /// 值
+        /// </summary>
+        public string Value { get; set; }
+        /// <summary>
+        /// 值类型
+        /// </summary>
+        public string ValueType { get; set; }
+
+        /// <summary>
+        /// 比较符号
+        /// </summary>
+        public ComparisonSymbol Operator { get; set; }
+    }
+}

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

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -8,9 +9,13 @@ namespace wispro.sp.entity.workflowDefine
 {
     public enum EnumFieldType
     {
+        [Description("文本")]
         Text,
+        [Description("数字")]
         Numberic,
+        [Description("日期")]
         Date,
+        [Description("列表")]
         List
     }
 }

+ 7 - 3
wospro.sp.entity/workflowDefine/inputValueSetting.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace wispro.sp.entity.workflowDefine
 {
-    public class inputValueSetting
+    public class InputValueSetting
     {
         public int Id { get; set; }
         /// <summary>
@@ -26,14 +26,18 @@ namespace wispro.sp.entity.workflowDefine
 
         public string bindFieldSavetoObjectCondition { get; set; }
 
-        public step step { get; set; }
+        public Action action { get; set; }
 
-        public int stepId { get; set; }
+        public int actionId { get; set; }
 
         /// <summary>
         /// 可选项目,多个以“|”隔开
         /// 例如:选项一|选项二|选项三
         /// </summary>
         public string Options { get; set; }
+
+        public InputValueSetting ParentSetting { get; set; }
+
+        public int? ParentSettingId { get; set; }
     }
 }

+ 2 - 2
wospro.sp.entity/workflowDefine/step.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace wispro.sp.entity.workflowDefine
 {
-    public class step
+    public class Step
     {
         /// <summary>
         /// 编号
@@ -21,7 +21,7 @@ namespace wispro.sp.entity.workflowDefine
         /// <summary>
         /// 流程
         /// </summary>
-        public workflow workflow { get; set; }
+        public Workflow workflow { get; set; }
 
         /// <summary>
         /// 流程Id

+ 3 - 3
wospro.sp.entity/workflowDefine/trasferCondition.cs

@@ -9,14 +9,14 @@ namespace wispro.sp.entity.workflowDefine
     /// <summary>
     /// 步骤转移条件
     /// </summary>
-    public class trasferCondition
+    public class TrasferCondition
     {
         public int Id { get; set; }
 
         /// <summary>
         /// 所属步骤
         /// </summary>
-        public step Step { get; set; }
+        public Step Step { get; set; }
 
         /// <summary>
         /// 所属步骤Id
@@ -32,7 +32,7 @@ namespace wispro.sp.entity.workflowDefine
         /// <summary>
         /// 下一步骤
         /// </summary>
-        public step nextStep { get; set; }
+        public Step nextStep { get; set; }
 
         /// <summary>
         /// 下一步骤Id

+ 12 - 3
wospro.sp.entity/workflowDefine/workflow.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace wispro.sp.entity.workflowDefine
 {
-    public class workflow
+    public class Workflow
     {
         /// <summary>
         /// 流程编号
@@ -24,9 +24,12 @@ namespace wispro.sp.entity.workflowDefine
         public string ContentObjectType { get; set; }
 
         /// <summary>
-        /// 初始化步骤Id
+        /// 初始化Action Id
+        /// 定义初始化流程的输入参数、UI等
         /// </summary>
-        public int InitStepId { get; set; }
+        public int InitActionId { get; set; }
+
+        public Action InitAction { get; set; }
 
         /// <summary>
         /// 结束步骤Id
@@ -34,5 +37,11 @@ namespace wispro.sp.entity.workflowDefine
         /// 不能做任何操作
         /// </summary>
         public int EndStepId { get; set; }
+
+        public DateTime CreateTime { get; set; }
+
+        public Staff CreateUser { get; set; }
+
+        public int CreateUserId { get; set; }
     }
 }

+ 2 - 2
wospro.sp.entity/workflowInstance/Instance.cs

@@ -7,12 +7,12 @@ using wispro.sp.entity.workflowDefine;
 
 namespace wispro.sp.entity.workflowInstance
 {
-    public class workflowInstance
+    public class WorkflowInstance
     {
         public int Id { get; set; }
 
 
-        public workflow workflow { get; set; }
+        public Workflow workflow { get; set; }
 
         public int workflowId { get; set; }
 

+ 6 - 2
wospro.sp.entity/workflowInstance/stepInputValue.cs

@@ -7,15 +7,19 @@ using wispro.sp.entity.workflowDefine;
 
 namespace wispro.sp.entity.workflowInstance
 {
-    public class stepInputValue
+    public class InputValue
     {
         public int Id { get; set; }
 
-        public inputValueSetting valueSetting { get; set; }
+        public InputValueSetting valueSetting { get; set; }
 
         public int valueSettingId{get;set;}
 
         public string value { get; set; }
 
+        public WorkflowInstance workflowInstance { get; set; }
+
+        public int workflowInstanceId { get; set; }
+
     }
 }

+ 4 - 4
wospro.sp.entity/workflowInstance/stepInstance.cs

@@ -7,18 +7,18 @@ using wispro.sp.entity.workflowDefine;
 
 namespace wispro.sp.entity.workflowInstance
 {
-    public class stepInstance
+    public class StepInstance
     {
         public int Id { get; set; }
 
-        public step Step { get; set; }
+        public Step Step { get; set; }
 
         public int stepId { get; set; }
 
-        public workflowInstance workflowInstance { get; set; }
+        public WorkflowInstance workflowInstance { get; set; }
 
         public int workflowInstanceId { get; set; }
 
-        public int PreviousStepId { get; set; }
+        public int? PreviousStepId { get; set; }
     }
 }