Bläddra i källkod

修正从IPEasy获取案件信息多个处理事项问题(添加一个案件阶段参数)
添加流EnumHelper类

luocaiyang 3 år sedan
förälder
incheckning
c03bbfd8d3

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

@@ -119,7 +119,7 @@ namespace wispro.sp.api.Controllers
             }
             else
             {
-                dynamic retObj = wispro.sp.utility.IPEasyUtility.GetPerformanctRecord(CaseNo, DoItem);
+                dynamic retObj = wispro.sp.utility.IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem);
                 PerformanceItem Item = new PerformanceItem();
                 Item.CaseName = retObj.CaseName;
                 Item.CaseNo = retObj.CaseNo;

+ 6 - 3
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -71,8 +71,13 @@ namespace wispro.sp.api.Controllers
 
                         if (temCustomer == null)
                         {
-                            Context.Customers.Add(item.Customer);
+                            temCustomer = new Customer() { Name = item.Customer.Name };
+                            //item.Customer.Id = 0;
+                            
+                            Context.Customers.Add(temCustomer);
                             Context.SaveChanges();
+                            item.Customer = temCustomer;
+                            //item.CustomerId = item.Customer.Id;
                         }
                         else
                         {
@@ -120,8 +125,6 @@ namespace wispro.sp.api.Controllers
 
                     Context.ItemStaffs.AddRange(ItemStaffs);
                     Context.SaveChanges();
-                        
-                    
 
                     Context.Database.CommitTransaction();
                 }

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

@@ -239,6 +239,8 @@ namespace wispro.sp.api.Job
 
                 if (item != null)
                 {
+                    item.CalMonth = calMonth;
+                    item.CalMonthId = calMonth.Id;
                     Items.Add(item);
                 }
             }
@@ -311,7 +313,11 @@ namespace wispro.sp.api.Job
             try
             {
                 Utility.Utility.CalBasePoint(item, rules);
-                new Controllers.PerformanceItemController(spDb).New(item);
+                var ret= new Controllers.PerformanceItemController(spDb).New(item);
+                if (ret.Success == false)
+                {
+                    System.Diagnostics.Debug.WriteLine(ret.ErrorMessage);
+                }
             }
             catch (Exception ex)
             {
@@ -515,13 +521,13 @@ namespace wispro.sp.api.Job
             {
                 return null;
             }
-
+            item.CaseNo = row["我方文号"].ToString().Trim();
             if (item.CaseNo.StartsWith("S"))
             {
                 return null;
             }
 
-            item.CaseNo = row["我方文号"].ToString().Trim();
+            
 
             if (calMonth != null)
             {

+ 202 - 0
wispro.sp.api/Job/UpdateJXDataFromIPEasyJob.cs

@@ -0,0 +1,202 @@
+using Microsoft.EntityFrameworkCore;
+using Quartz;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using wispro.sp.entity;
+
+namespace wispro.sp.api.Job
+{
+    public class UpdateJXDataFromIPEasyJob: IJob
+    {
+        public Task Execute(IJobExecutionContext context)
+        {
+            spDbContext spDb = new spDbContext();
+
+            var lstItem = spDb.PerformanceItems.Where<PerformanceItem>(p =>
+                (p.DoItem == "新申请" && (p.CaseCoefficient == null || p.CaseCoefficient == "") && p.CalMonth.Status ==0) ||
+                (p.DoItem == "处理审查意见" && (p.CaseStage == "一通" || p.CaseStage == "二通") && (p.DoItemCoefficient == null || p.DoItemCoefficient == "") && p.CalMonth.Status == 0))
+                .Include(p=>p.Reviewer)
+                .ToList<PerformanceItem>()
+                ;
+
+            if(lstItem != null)
+            {
+                int i = 0;
+                foreach(var Item in lstItem)
+                {
+                    System.Diagnostics.Debug.WriteLine($"{DateTime.Now}\t{++i}\t{Item.CaseNo}");
+                    try
+                    {
+                        dynamic retObj = utility.IPEasyUtility.GetPerformanceRecord(Item.CaseNo, Item.DoItem,string.IsNullOrEmpty(Item.CaseStage)?null: Item.CaseStage);
+
+
+                        IDictionary<String, Object> keyValuePairs = (IDictionary<String, Object>)retObj;
+
+                        if (keyValuePairs.ContainsKey("DoItemCoefficient") && Item.DoItemCoefficient != retObj.DoItemCoefficient)
+                        {
+                            Item.DoItemCoefficient = retObj.DoItemCoefficient;
+                        }
+
+                        if (keyValuePairs.ContainsKey("DoItemMemo") && Item.DoItemMemo != retObj.DoItemMemo && !string.IsNullOrEmpty(retObj.DoItemMemo))
+                        {
+                            Item.DoItemMemo = retObj.DoItemMemo;
+                        }
+
+                        if (keyValuePairs.ContainsKey("DoItemState") && Item.DoItemState != retObj.DoItemState && !string.IsNullOrEmpty(retObj.DoItemState))
+                        {
+                            Item.DoItemState = retObj.DoItemState;
+                        }
+
+                        if (keyValuePairs.ContainsKey("CustomerLimitDate"))
+                        {
+                            if (!string.IsNullOrEmpty(retObj.CustomerLimitDate))
+                            {
+                                DateTime date = DateTime.Parse(retObj.CustomerLimitDate);
+
+                                if (date != Item.CustomerLimitDate)
+                                    Item.CustomerLimitDate = date;
+                            }
+                        }
+
+                        if (keyValuePairs.ContainsKey("EntrustingDate"))
+                        {
+                            if (!string.IsNullOrEmpty(retObj.EntrustingDate))
+                            {
+                                DateTime date = DateTime.Parse(retObj.EntrustingDate);
+
+                                if (date != Item.EntrustingDate)
+                                    Item.EntrustingDate = date;
+                            }
+                        }
+
+                        if (keyValuePairs.ContainsKey("FinalizationDate"))
+                        {
+                            if (!string.IsNullOrEmpty(retObj.FinalizationDate))
+                            {
+                                DateTime date = DateTime.Parse(retObj.FinalizationDate);
+
+                                if (date != Item.FinalizationDate)
+                                    Item.FinalizationDate = date;
+                            }
+                        }
+
+                        if (keyValuePairs.ContainsKey("FinishedDate"))
+                        {
+                            if (!string.IsNullOrEmpty(retObj.FinishedDate))
+                            {
+                                DateTime date = DateTime.Parse(retObj.FinishedDate);
+
+                                if (date != Item.FinishedDate)
+                                    Item.FinishedDate = date;
+                            }
+                        }
+
+                        if (keyValuePairs.ContainsKey("FirstDraftDate"))
+                        {
+                            if (!string.IsNullOrEmpty(retObj.FirstDraftDate))
+                            {
+                                DateTime date = DateTime.Parse(retObj.FirstDraftDate);
+
+                                if (date != Item.FirstDraftDate)
+                                    Item.FirstDraftDate = date;
+                            }
+                        }
+
+                        if (keyValuePairs.ContainsKey("InternalDate"))
+                        {
+                            if (!string.IsNullOrEmpty(retObj.InternalDate))
+                            {
+                                DateTime date = DateTime.Parse(retObj.InternalDate);
+
+                                if (date != Item.InternalDate)
+                                    Item.InternalDate = date;
+                            }
+                        }
+
+                        if (keyValuePairs.ContainsKey("ReturnDate"))
+                        {
+                            if (!string.IsNullOrEmpty(retObj.ReturnDate))
+                            {
+                                DateTime date = DateTime.Parse(retObj.ReturnDate);
+
+                                if (date != Item.ReturnDate)
+                                    Item.ReturnDate = date;
+                            }
+                        }
+
+                        
+                        if (keyValuePairs.ContainsKey("Reviewer") && (Item.Reviewer ==null || Item.Reviewer.Name != retObj.Reviewer) && !string.IsNullOrEmpty(retObj.Reviewer))
+                        {
+                            string name = retObj.Reviewer;
+
+                            if (!string.IsNullOrEmpty(name))
+                            {
+                                var temReviewer = spDb.Staffs.Where<Staff>(s => s.Name == name).FirstOrDefault();
+                                if (temReviewer == null)
+                                {
+                                    //Item.Reviewer = new Staff() { Name = retObj.Reviewer };
+                                }
+                                else
+                                {
+                                    //Item.Reviewer = temReviewer;
+                                    //Item.ReviewerId = temReviewer.Id;
+                                }
+                            }
+                        }
+
+                        if (keyValuePairs.ContainsKey("ApplicationType") && Item.ApplicationType != retObj.ApplicationType && !string.IsNullOrEmpty(retObj.ApplicationType))
+                        {
+                            Item.ApplicationType = retObj.ApplicationType;
+                        }
+
+                        if (keyValuePairs.ContainsKey("BusinessType") && Item.BusinessType != retObj.BusinessType && !string.IsNullOrEmpty(retObj.BusinessType))
+                        {
+                            Item.BusinessType = retObj.BusinessType;
+                        }
+
+                        if (keyValuePairs.ContainsKey("CaseCoefficient") && Item.CaseCoefficient != retObj.CaseCoefficient && !string.IsNullOrEmpty(retObj.CaseCoefficient))
+                        {
+                            if (!string.IsNullOrEmpty(retObj.CaseCoefficient)){
+                                Item.CaseCoefficient = retObj.CaseCoefficient;
+                            }
+                        }
+
+                        //if (keyValuePairs.ContainsKey("CaseMemo") && Item.CaseMemo != retObj.CaseMemo && !string.IsNullOrEmpty(retObj.CaseMemo))
+                        //{
+                        //    Item.CaseMemo = retObj.CaseMemo;
+                        //}
+
+                        if (keyValuePairs.ContainsKey("CaseStage") && Item.CaseStage != retObj.CaseStage && !string.IsNullOrEmpty(retObj.CaseStage))
+                        {
+                            Item.CaseStage = retObj.CaseStage;
+                        }
+
+                        if (keyValuePairs.ContainsKey("CaseState") && Item.CaseState != retObj.CaseState && !string.IsNullOrEmpty(retObj.CaseState))
+                        {
+                            Item.CaseState = retObj.CaseState;
+                        }
+
+                        if (keyValuePairs.ContainsKey("CaseType") && Item.CaseType != retObj.CaseType && !string.IsNullOrEmpty(retObj.CaseType))
+                        {
+                            Item.CaseType = retObj.CaseType;
+                        }
+
+                        if (spDb.Entry(Item).State != EntityState.Unchanged)
+                        {
+                            Utility.Utility.CalBasePoint(Item, spDb.BasePointRules.ToList());
+                            spDb.SaveChanges();
+                        }
+                    }
+                    catch(Exception ex)
+                    {
+                        System.Diagnostics.Debug.WriteLine(ex.ToString());
+                    }
+                }
+            }
+
+            return Task.CompletedTask;
+        }
+    }
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3380 - 0
wispro.sp.api/Migrations/20211202034338_workflow-modify.Designer.cs


+ 139 - 0
wispro.sp.api/Migrations/20211202034338_workflow-modify.cs

@@ -0,0 +1,139 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace wispro.sp.api.Migrations
+{
+    public partial class workflowmodify : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<DateTime>(
+                name: "CreateTime",
+                table: "Workflow",
+                type: "datetime2",
+                nullable: false,
+                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
+
+            migrationBuilder.AddColumn<int>(
+                name: "CreateUserId",
+                table: "Workflow",
+                type: "int",
+                nullable: false,
+                defaultValue: 0);
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "EffectivrDate",
+                table: "Workflow",
+                type: "datetime2",
+                nullable: false,
+                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "ExpirationDate",
+                table: "Workflow",
+                type: "datetime2",
+                nullable: false,
+                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
+
+            migrationBuilder.AddColumn<string>(
+                name: "Memo",
+                table: "Workflow",
+                type: "nvarchar(max)",
+                nullable: true);
+
+            migrationBuilder.AlterColumn<string>(
+                name: "DoItemMemo",
+                table: "PerformanceItem",
+                type: "nvarchar(max)",
+                nullable: true,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(500)",
+                oldMaxLength: 500,
+                oldNullable: true);
+
+            migrationBuilder.InsertData(
+                table: "BasePointRule",
+                columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
+                values: new object[] { 138, "0.2", 85, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"形式\" && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)", "OA" });
+
+            migrationBuilder.InsertData(
+                table: "BasePointRule",
+                columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
+                values: new object[] { 139, "0.5", 84, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"实质\" && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)", "OA" });
+
+            migrationBuilder.InsertData(
+                table: "BasePointRule",
+                columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
+                values: new object[] { 140, "0.3", 83, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"非实质\"  && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)", "OA" });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Workflow_CreateUserId",
+                table: "Workflow",
+                column: "CreateUserId");
+
+            migrationBuilder.AddForeignKey(
+                name: "FK_Workflow_Staff_CreateUserId",
+                table: "Workflow",
+                column: "CreateUserId",
+                principalTable: "Staff",
+                principalColumn: "Id",
+                onDelete: ReferentialAction.Cascade);
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropForeignKey(
+                name: "FK_Workflow_Staff_CreateUserId",
+                table: "Workflow");
+
+            migrationBuilder.DropIndex(
+                name: "IX_Workflow_CreateUserId",
+                table: "Workflow");
+
+            migrationBuilder.DeleteData(
+                table: "BasePointRule",
+                keyColumn: "Id",
+                keyValue: 138);
+
+            migrationBuilder.DeleteData(
+                table: "BasePointRule",
+                keyColumn: "Id",
+                keyValue: 139);
+
+            migrationBuilder.DeleteData(
+                table: "BasePointRule",
+                keyColumn: "Id",
+                keyValue: 140);
+
+            migrationBuilder.DropColumn(
+                name: "CreateTime",
+                table: "Workflow");
+
+            migrationBuilder.DropColumn(
+                name: "CreateUserId",
+                table: "Workflow");
+
+            migrationBuilder.DropColumn(
+                name: "EffectivrDate",
+                table: "Workflow");
+
+            migrationBuilder.DropColumn(
+                name: "ExpirationDate",
+                table: "Workflow");
+
+            migrationBuilder.DropColumn(
+                name: "Memo",
+                table: "Workflow");
+
+            migrationBuilder.AlterColumn<string>(
+                name: "DoItemMemo",
+                table: "PerformanceItem",
+                type: "nvarchar(500)",
+                maxLength: 500,
+                nullable: true,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(max)",
+                oldNullable: true);
+        }
+    }
+}

+ 50 - 2
wispro.sp.api/Migrations/spDbContextModelSnapshot.cs

@@ -1292,6 +1292,30 @@ namespace wispro.sp.api.Migrations
                             Priority = 250,
                             Rule = "p.CaseNo.StartsWith(\"S\")",
                             Type = "专案"
+                        },
+                        new
+                        {
+                            Id = 138,
+                            PointExpress = "0.2",
+                            Priority = 85,
+                            Rule = "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"形式\" && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)",
+                            Type = "OA"
+                        },
+                        new
+                        {
+                            Id = 139,
+                            PointExpress = "0.5",
+                            Priority = 84,
+                            Rule = "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"实质\" && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)",
+                            Type = "OA"
+                        },
+                        new
+                        {
+                            Id = 140,
+                            PointExpress = "0.3",
+                            Priority = 83,
+                            Rule = "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"非实质\"  && (p.PreOastaffId != null && p.ItemStaffs.Where<ItemStaff>(s => s.DoPersonId == p.PreOastaffId).Count() == 0)",
+                            Type = "OA"
                         });
                 });
 
@@ -1871,8 +1895,7 @@ namespace wispro.sp.api.Migrations
                         .HasColumnType("nvarchar(50)");
 
                     b.Property<string>("DoItemMemo")
-                        .HasMaxLength(500)
-                        .HasColumnType("nvarchar(500)");
+                        .HasColumnType("nvarchar(max)");
 
                     b.Property<string>("DoItemState")
                         .HasMaxLength(50)
@@ -2779,17 +2802,34 @@ namespace wispro.sp.api.Migrations
                     b.Property<string>("ContentObjectType")
                         .HasColumnType("nvarchar(max)");
 
+                    b.Property<DateTime>("CreateTime")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("CreateUserId")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("EffectivrDate")
+                        .HasColumnType("datetime2");
+
                     b.Property<int>("EndStepId")
                         .HasColumnType("int");
 
+                    b.Property<DateTime>("ExpirationDate")
+                        .HasColumnType("datetime2");
+
                     b.Property<int>("InitActionId")
                         .HasColumnType("int");
 
+                    b.Property<string>("Memo")
+                        .HasColumnType("nvarchar(max)");
+
                     b.Property<string>("Name")
                         .HasColumnType("nvarchar(max)");
 
                     b.HasKey("Id");
 
+                    b.HasIndex("CreateUserId");
+
                     b.HasIndex("InitActionId");
 
                     b.ToTable("Workflow");
@@ -3210,12 +3250,20 @@ namespace wispro.sp.api.Migrations
 
             modelBuilder.Entity("wispro.sp.entity.workflowDefine.Workflow", b =>
                 {
+                    b.HasOne("wispro.sp.entity.Staff", "CreateUser")
+                        .WithMany()
+                        .HasForeignKey("CreateUserId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
                     b.HasOne("wispro.sp.entity.workflowDefine.Action", "InitAction")
                         .WithMany()
                         .HasForeignKey("InitActionId")
                         .OnDelete(DeleteBehavior.NoAction)
                         .IsRequired();
 
+                    b.Navigation("CreateUser");
+
                     b.Navigation("InitAction");
                 });
 

+ 14 - 2
wispro.sp.api/Program.cs

@@ -41,8 +41,8 @@ namespace wispro.sp.api
                     //logger.LogError(ex, "An error occurred.");
                 }
             }
-            
 
+            #region 每月获取绩效数据Job
             JobKey jobKey = new JobKey("ImportReportData");
             var trigger = TriggerBuilder.Create()
                 .WithDescription("导入每月报表")
@@ -51,7 +51,19 @@ namespace wispro.sp.api
 
 
             QuartzUtil.Add(typeof(ImportReportJob), jobKey, trigger);
-            
+            #endregion
+
+            #region 每天更新绩效数据
+            JobKey jobKey1 = new JobKey("UpdateSchedule");
+            var trigger1 = TriggerBuilder.Create()
+                .WithDescription("更新绩效数据")
+                .WithSchedule(CronScheduleBuilder.CronSchedule(utility.ConfigHelper.GetSectionValue("UpdateScheduleSetting")).WithMisfireHandlingInstructionDoNothing())
+                .Build();
+
+
+            QuartzUtil.Add(typeof(UpdateJXDataFromIPEasyJob), jobKey1, trigger1);
+            #endregion
+
 
             host.Run();
         }

+ 24 - 13
wispro.sp.api/Utility/Utility.cs

@@ -22,23 +22,34 @@ namespace wispro.sp.api.Utility
 
             foreach (BasePointRule rule in rules)
             {
-                var interpreter = new Interpreter();
-                //item.ApplicationType
-                Func<PerformanceItem, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem, bool>>(rule.Rule, "p");
-                
-                bool result = func.Invoke(item);
+                var options = InterpreterOptions.Default | InterpreterOptions.LambdaExpressions;
+                var interpreter = new Interpreter(options)
+                    .Reference(typeof(System.Linq.Enumerable));
 
-                if (result)
+                //System.Diagnostics.Debug.WriteLine(rule.Rule);
+
+                try
                 {
-                    var temString = rule.PointExpress;
-                    if (!rule.PointExpress.Contains("."))
+                    //item.ApplicationType
+                    Func<PerformanceItem, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem, bool>>(rule.Rule, "p");
+
+                    bool result = func.Invoke(item);
+
+                    if (result)
                     {
-                        temString = $"{rule.PointExpress.Trim()}.0";
-                    }
+                        var temString = rule.PointExpress;
+                        if (!rule.PointExpress.Contains("."))
+                        {
+                            temString = $"{rule.PointExpress.Trim()}.0";
+                        }
 
-                    item.BasePoint = (double?)interpreter.Eval(temString);
-                    item.Type = rule.Type;
-                    break;
+                        item.BasePoint = (double?)interpreter.Eval(temString);
+                        item.Type = rule.Type;
+                        break;
+                    }
+                }
+                catch(Exception ex) {
+                    System.Diagnostics.Debug.WriteLine(ex.Message);
                 }
             }
             #endregion

+ 6 - 5
wispro.sp.api/appsettings.json

@@ -11,6 +11,7 @@
     "DefaultConnect": "Data Source=(local);Initial Catalog=spDB;User ID=sa;Password=Lqftiu807005"
   },
 
+  "UpdateScheduleSetting": "00 43 08,16 * * ? *",
 
   "ValidAudience": "StaffPerformance",
   "ValidIssuer": "http://localhost:39476",
@@ -27,15 +28,15 @@
     "Account": "caiyangl",
     "Password": "j)wx*lier*@3",
     "ChormeDriverPath": "D:\\source\\repos\\ConsoleApp2\\ConsoleApp2\\bin\\Debug",
-    "ScheduleSetting": "00 23 18 * * ? *",
+    "ScheduleSetting": "00 51 13 1 * ? *",
     "IPEasyWeb": "http://47.106.221.167/Login.aspx"
   },
 
   "MailSetting": {
-    "Server": "smtp.qq.com",
+    "Server": "smtp.exmail.qq.com",
     "Port": "465",
-    "mail": "luocaiyang@qq.com",
-    "Account": "516337988",
-    "Password": "j)wx*lier*@3"
+    "Account": "luocaiyang@china-wispro.com",
+    "Password": "Lqftiu807005",
+    "mail": "luocaiyang@china-wispro.com"
   }
 }

+ 11 - 4
wispro.sp.api/spDbContext.cs

@@ -1,5 +1,8 @@
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Debug;
+using System;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Data;
@@ -11,6 +14,9 @@ namespace wispro.sp.api
 {
     public partial class spDbContext : DbContext
     {
+        [Obsolete]
+        public static readonly LoggerFactory LoggerFactory = new LoggerFactory(new[] { new DebugLoggerProvider() });
+
         public spDbContext()
         {
         }
@@ -63,7 +69,7 @@ namespace wispro.sp.api
 
         public virtual DbSet<TrasferCondition> TrasferConditions { get; set; }
 
-        public virtual DbSet<Action> Actions { get; set; }
+        public virtual DbSet<entity.workflowDefine.Action> Actions { get; set; }
 
         public virtual DbSet<InputValueSetting> InputValueSettings { get; set; }
 
@@ -77,6 +83,7 @@ namespace wispro.sp.api
 
         public virtual DbSet<DepartmentPosition> DepartmentPositions { get; set; }
 
+        
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             if (!optionsBuilder.IsConfigured)
@@ -84,6 +91,8 @@ namespace wispro.sp.api
                 optionsBuilder.UseSqlServer(utility.ConfigHelper.GetSectionValue("ConnectionStrings:DefaultConnect"));// "Data Source=(local);Initial Catalog=spDB;User ID=sa;Password=Lqftiu807005");// Configuration.GetConnectionString("DefaultConnect"));
                 //ConfigurationManager.AppSettings["ValidAudience"]
             }
+
+            _ = optionsBuilder.UseLoggerFactory(LoggerFactory);
         }
 
         protected override void OnModelCreating(ModelBuilder modelBuilder)
@@ -186,8 +195,6 @@ namespace wispro.sp.api
 
                 entity.Property(e => e.DoItemCoefficient).HasMaxLength(50);
 
-                entity.Property(e => e.DoItemMemo).HasMaxLength(500);
-
                 entity.Property(e => e.DoItemState).HasMaxLength(50);
 
                 entity.Property(e => e.FinalizationDate).HasColumnType("date");
@@ -723,7 +730,7 @@ namespace wispro.sp.api
                     .OnDelete(DeleteBehavior.NoAction);
             });
 
-            modelBuilder.Entity<Action>(entity => {
+            modelBuilder.Entity<entity.workflowDefine.Action>(entity => {
                 entity.ToTable("Action");
 
                 entity.HasOne(d => d.step)

+ 1 - 0
wispro.sp.api/wispro.sp.api.csproj

@@ -15,6 +15,7 @@
     </PackageReference>
     <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.9" />
     <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
     <PackageReference Include="Quartz" Version="3.3.3" />
   </ItemGroup>
 

+ 79 - 0
wispro.sp.utility/EmunHelper.cs

@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.utility
+{
+    public class EmunHelper
+    {
+        
+        ///// <summary>
+        ///// 根据枚举的值获取枚举名称
+        ///// </summary>
+        ///// <typeparam name="T">枚举类型</typeparam>
+        ///// <param name="status">枚举的值</param>
+        ///// <returns></returns>
+        //public static string GetEnumName<T>(this int status)
+        //{
+        //    return Enum.GetName(typeof(T), status);
+        //}
+        /// <summary>
+        /// 获取枚举名称集合
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <returns></returns>
+        public static string[] GetNamesArr<T>()
+        {
+            return Enum.GetNames(typeof(T));
+        }
+        /// <summary>
+        /// 将枚举转换成描述字典集合
+        /// </summary>
+        /// <typeparam name="T">枚举类型</typeparam>
+        /// <returns></returns>
+        public static Dictionary<string, T> getEnumDescriptionDic<T>()
+        {
+            Dictionary<string, T> resultList = new Dictionary<string, T>();
+            Type type = typeof(T);
+            var strList = GetNamesArr<T>().ToList();
+            foreach (string key in strList)
+            {
+                var obj = (T)Enum.Parse(type, key);
+                FieldInfo field=  obj.GetType().GetField(obj.ToString());
+
+                DescriptionAttribute att = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute), false) as DescriptionAttribute;
+                
+                if (att == null)
+                {
+                    resultList.Add(key, obj);
+                }
+                else
+                {
+                    resultList.Add(att.Description, obj);
+                }
+            }
+            return resultList;
+        }
+        /// <summary>
+        /// 将枚举转换成字典
+        /// </summary>
+        /// <typeparam name="TEnum"></typeparam>
+        /// <returns></returns>
+        public static Dictionary<string, int> GetDic<TEnum>()
+        {
+            Dictionary<string, int> dic = new Dictionary<string, int>();
+            Type t = typeof(TEnum);
+            var arr = Enum.GetValues(t);
+            foreach (var item in arr)
+            {
+                dic.Add(item.ToString(), (int)item);
+            }
+
+            return dic;
+        }
+    }
+}

+ 45 - 12
wispro.sp.utility/IPEasyUtility.cs

@@ -300,7 +300,7 @@ namespace wispro.sp.utility
         /// <param name="caseNo">我方文号</param>
         /// <param name="doItemName">处理事项</param>
         /// <returns></returns>
-        public static dynamic GetPerformanctRecord(string caseNo,string doItemName)
+        public static dynamic GetPerformanceRecord(string caseNo,string doItemName,string caseStage=null)
         {
             string strFileSavePath = ConfigHelper.GetSectionValue("IPEasySetting:DownloadFileSavePath");
             bool isheadless = (ConfigHelper.GetSectionValue("IPEasySetting:isHeadless") == "true");
@@ -348,10 +348,11 @@ namespace wispro.sp.utility
 
                 //点击顶部菜单栏中的案件管理菜单
                 driver.FindElement(By.Name("71A7CC35-F597-40E1-9FEF-BE622A3A3B63")).Click();
+                System.Threading.Thread.Sleep(500);
 
                 //点击左侧 查询 菜单
                 driver.FindElement(By.Name("c3266ab3-521a-4815-8aaf-7dd0bc5a76af")).Click();
-
+                System.Threading.Thread.Sleep(500);
                 //切换到自定义报表Frame
                 driver.SwitchTo().Frame(1);
 
@@ -360,21 +361,52 @@ namespace wispro.sp.utility
 
                 var btnSearch = driver.FindElement(By.Id("btn_Search"));
                 btnSearch.Click();
+                System.Threading.Thread.Sleep(500);
 
-                var caseLink = driver.FindElement(By.XPath($"//a[contains(text(),'{caseNo}')]"));
+                var caseLink = driver.FindElement(By.XPath($"//a[normalize-space()='{caseNo}']"));
                 caseLink.Click();
                 System.Threading.Thread.Sleep(500);
 
                 driver.SwitchTo().ParentFrame().SwitchTo().Frame(2);
-                var DoItemLink = driver.FindElement(By.XPath($"//td[contains(text(),'{doItemName}')]"));
-                retObject.CaseStage = DoItemLink.FindElement(By.XPath("following-sibling::td[1]")).Text; //案件阶段
-                retObject.DoItemState = DoItemLink.FindElement(By.XPath("following-sibling::td[2]")).Text;    //处理事项处理状态
-                retObject.InternalDate = DoItemLink.FindElement(By.XPath("following-sibling::td[4]")).Text;   //内部期限
-                retObject.CustomerLimitDate = DoItemLink.FindElement(By.XPath("following-sibling::td[5]")).Text;   //客户期限
-                retObject.FinishedDate = DoItemLink.FindElement(By.XPath("following-sibling::td[7]")).Text;   //处理事项完成日
-                retObject.DoPersons = DoItemLink.FindElement(By.XPath("following-sibling::td[8]")).Text;   //处理人
-                retObject.DoItemMemo = DoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //处理事项备注
-                DoItemLink.Click();
+                var DoItemLinks = driver.FindElements(By.XPath($"//td[@colname='ctrl_proc'][normalize-space()='{doItemName}']"));
+                if (DoItemLinks.Count > 0)
+                {
+                    if (caseStage != null)
+                    {
+                        foreach(var DoItemLink in DoItemLinks)
+                        {
+                            var temCaseStage = DoItemLink.FindElement(By.XPath("following-sibling::td[1]")).Text;
+                            if(temCaseStage == caseStage)
+                            {
+                                retObject.CaseStage = DoItemLink.FindElement(By.XPath("following-sibling::td[1]")).Text; //案件阶段
+                                retObject.DoItemState = DoItemLink.FindElement(By.XPath("following-sibling::td[2]")).Text;    //处理事项处理状态
+                                retObject.InternalDate = DoItemLink.FindElement(By.XPath("following-sibling::td[4]")).Text;   //内部期限
+                                retObject.CustomerLimitDate = DoItemLink.FindElement(By.XPath("following-sibling::td[5]")).Text;   //客户期限
+                                retObject.FinishedDate = DoItemLink.FindElement(By.XPath("following-sibling::td[7]")).Text;   //处理事项完成日
+                                retObject.DoPersons = DoItemLink.FindElement(By.XPath("following-sibling::td[8]")).Text;   //处理人
+                                retObject.DoItemMemo = DoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //处理事项备注
+
+                                DoItemLink.Click();
+                                break;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        var DoItemLink = DoItemLinks[DoItemLinks.Count - 1];
+                        retObject.CaseStage = DoItemLink.FindElement(By.XPath("following-sibling::td[1]")).Text; //案件阶段
+                        retObject.DoItemState = DoItemLink.FindElement(By.XPath("following-sibling::td[2]")).Text;    //处理事项处理状态
+                        retObject.InternalDate = DoItemLink.FindElement(By.XPath("following-sibling::td[4]")).Text;   //内部期限
+                        retObject.CustomerLimitDate = DoItemLink.FindElement(By.XPath("following-sibling::td[5]")).Text;   //客户期限
+                        retObject.FinishedDate = DoItemLink.FindElement(By.XPath("following-sibling::td[7]")).Text;   //处理事项完成日
+                        retObject.DoPersons = DoItemLink.FindElement(By.XPath("following-sibling::td[8]")).Text;   //处理人
+                        retObject.DoItemMemo = DoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //处理事项备注
+
+                        DoItemLink.Click();
+                    }
+                }
+                
+                System.Threading.Thread.Sleep(500);
 
                 retObject.FinalizationDate = driver.FindElement(By.Id("p_proc_info__finish_doc_date")).GetAttribute("value"); //定稿日
                 retObject.ReturnDate = driver.FindElement(By.Id("p_proc_info__back_date")).GetAttribute("value"); //返稿日
@@ -382,6 +414,7 @@ namespace wispro.sp.utility
                 retObject.DoItemCoefficient = driver.FindElement(By.Id("p_proc_info__proc_coefficient")).GetAttribute("value");     //处理事项系数
 
                 driver.FindElement(By.Id("libase")).Click();
+                System.Threading.Thread.Sleep(500);
                 retObject.CaseName = driver.FindElement(By.Id("p_case_info__case_name")).GetAttribute("value");  //案件名称
                 retObject.CustomerName = driver.FindElement(By.Id("p_case_info__customer_id")).GetAttribute("value");  //客户名称
                 retObject.BusinessType = driver.FindElement(By.Id("p_case_info__business_type_id")).GetAttribute("value");     //业务类型

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

@@ -15,7 +15,8 @@ namespace wispro.sp.utility
         public static void SendEmail(string subject, string body,string toMailName, string toEmail)
         {
             MimeMessage message = new MimeMessage();
-            MailboxAddress from = new MailboxAddress("绩效系统",ConfigHelper.GetSectionValue("MailSetting:mail"));
+            string strMail = ConfigHelper.GetSectionValue("MailSetting:mail");
+            MailboxAddress from = new MailboxAddress("绩效系统",strMail);
             message.From.Add(from);
             MailboxAddress to = new MailboxAddress(toMailName, toEmail);
             message.To.Add(to);
@@ -26,8 +27,14 @@ namespace wispro.sp.utility
             message.Body = bodyBuilder.ToMessageBody();
 
             SmtpClient client = new SmtpClient();
-            client.Connect(ConfigHelper.GetSectionValue("MailSetting:Server"), int.Parse(ConfigHelper.GetSectionValue("MailSetting:Port")),true);  //例如:smtp.exmail.qq.com,465
-            client.Authenticate(ConfigHelper.GetSectionValue("MailSetting:Account"), ConfigHelper.GetSectionValue("MailSetting:Password")); //发送邮件的账户密码
+            var strServer = ConfigHelper.GetSectionValue("MailSetting:Server");
+            var strPort = ConfigHelper.GetSectionValue("MailSetting:Port");
+            var strAccount = ConfigHelper.GetSectionValue("MailSetting:Account");
+            var strPassword = ConfigHelper.GetSectionValue("MailSetting:Password");
+
+
+            client.Connect(strServer , int.Parse(strPort),true);  //例如:smtp.exmail.qq.com,465
+            client.Authenticate(strAccount, strPassword); //发送邮件的账户密码
             client.Send(message);
             client.Disconnect(true);
             client.Dispose();

+ 83 - 7
wispro.sp.web/Pages/Workflow/WorkflowDefine.razor

@@ -1,20 +1,96 @@
-<PageContainer>
+@page "/Workflow/Manage"
+@using wispro.sp.entity
+ 
+<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>
+                <Icon Type="apartment" Theme="outline" /><span>流程管理</span>
             </BreadcrumbItem>
         </Breadcrumb>
     </Breadcrumb>
     <Content>
-        <Button Type="primary" Icon="plus" OnClick="AddNew" Style="float:right">添加</Button>
+        <Select DataSource="@FieldTypes"
+                @bind-Value="@fieldType"
+                LabelName="@nameof(wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>.Description)"
+                ValueName="@nameof(wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>.Value)"
+                Placeholder="请选项一项"
+                DefaultActiveFirstItem="false"
+                EnableSearch="true"
+                AllowClear="true"
+                Style="width:220px;"
+                >
+        </Select>
+        <Button Type="primary" Icon="plus" OnClick="AddNew" Style="float:right">添加新流程</Button>
     </Content>
     <ChildContent>
+        @if (workflows == null) { 
+            <Spin/>
+        }
+        else
+        {
+        <AntDesign.Table @ref="table" @bind-PageIndex="_pageIndex" @bind-PageSize="_pageSize"
+                         TItem="wispro.sp.entity.workflowDefine.Workflow"
+                         Loading="_loading"
+                         DataSource="@workflows"
+                         Total="_total"
+                         Bordered=@true
+                         Size=@TableSize.Middle
+                         >
+            <ChildContent>
+                <Selection Key="@(context.Id.ToString())" />
+                <AntDesign.Column Title="序号" TData="int">
+                    @serialNumber(_pageIndex, _pageSize, context.Id)
+                </AntDesign.Column>
+                <AntDesign.Column Title="流程名称" @bind-Field="@context.Name" Sortable Filterable />
+                <AntDesign.Column Title="创建日期" @bind-Field="@context.CreateTime" Format="yyyy-MM-dd" Sortable Filterable />
+
+                <AntDesign.Column Title="生效日期" @bind-Field="@context.EffectivrDate" Format="yyyy-MM-dd" Sortable Filterable />
+                <AntDesign.Column Title="失效日期" @bind-Field="@context.ExpirationDate" Format="yyyy-MM-dd" Sortable Filterable />
+                <AntDesign.Column Title="说明" @bind-Field="@context.Memo" Filterable />
+                <AntDesign.Column Title="创建人" TData="string">
+                    
+                        @if (context.CreateUser != null)
+                        {
+                            <span>@context.CreateUser.Name</span>
+                        }
+                    
+                </AntDesign.Column>
+                <ActionColumn>
+                    <Space>
+                        <SpaceItem><Button OnClick="()=>Detail(context.Id)">详情</Button></SpaceItem>
+                    </Space>
+                    <Space>
+                        <SpaceItem><Button Danger OnClick="()=>Delete(context.Id)">删除</Button></SpaceItem>
+                    </Space>
+                </ActionColumn>
+            </ChildContent>
+            <PaginationTemplate>
+                <div style="display: flex; align-items: center">
+                    <Pagination Class="my-custom-pagination"
+                                Total="@_total"
+                                PageSize="@_pageSize"
+                                Current="@_pageIndex"
+                                ShowSizeChanger="@true"
+                                
+                                    />
+                </div>
+            </PaginationTemplate>
+        </AntDesign.Table>
+        }
     </ChildContent>
-</PageContainer>
+</PageContainer>
+
+<style>
+    .my-custom-pagination {
+        margin: 15px 0;
+    }
+
+        .my-custom-pagination .ant-pagination-item,
+        .my-custom-pagination .ant-pagination-item-link {
+            border-radius: 100%;
+        }
+</style>

+ 58 - 1
wispro.sp.web/Pages/Workflow/WorkflowDefine.razor.cs

@@ -1,4 +1,6 @@
-using System;
+using AntDesign;
+using AntDesign.TableModels;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
@@ -8,11 +10,66 @@ 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>();
+        ITable table;
+
+        int _pageIndex = 1;
+        int _pageSize = 10;
+        int _total = 0;
+        bool _loading = false;
+
+        wispro.sp.entity.workflowDefine.Workflow EditingObj = null;
+        bool _visible = false;
+
+        List<wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>> FieldTypes
+            = entity.EnumHelper.getEnumDescriptionDic<wispro.sp.entity.workflowDefine.FieldType>();
+
+        entity.workflowDefine.FieldType fieldType = entity.workflowDefine.FieldType.ActionInputValue;
         protected override async System.Threading.Tasks.Task OnInitializedAsync()
         {
             await base.OnInitializedAsync();
         }
 
+        private void AddNew()
+        {
+            
+        }
+
+        public int serialNumber(int pageIndex, int pageSize, int Id)
+        {
+            int iIndex = 0;
+            foreach (wispro.sp.entity.workflowDefine.Workflow sf in workflows)
+            {
+                iIndex++;
+
+                if (sf.Id  == Id)
+                {
+                    break;
+                }
+            }
+            return (pageIndex - 1) * pageSize + iIndex;
+        }
+
+        wispro.sp.entity.workflowDefine.Workflow SelectedWorkflow;
+        Dictionary<string, object> OnRow(RowData<wispro.sp.entity.workflowDefine.Workflow> row) => new()
+        {
+            ["id"] = row.Data.Id,
+            ["onclick"] = ((Action)delegate
+            {
+                SelectedWorkflow = row.Data;
+                Console.WriteLine($"row {row.Data.Name} was clicked");
+            })
+        };
+
+        void Delete(int Id)
+        {
+
+        }
+
+        void Detail(int Id)
+        {
+
+        }
+
 
     }
 }

+ 13 - 3
wispro.sp.winClient/Form1.cs

@@ -170,9 +170,19 @@ namespace wispro.sp.winClient
 
         }
 
+        enum enumTest
+        {
+            [Description("男")]
+            man,
+            [Description("女")]
+            woman
+        }
 
         private async void button3_Click(object sender, EventArgs e)
         {
+            var test =wispro.sp.utility.EmunHelper.getEnumDescriptionDic<wispro.sp.entity.workflowDefine.LogicSymbols>();
+
+            Console.WriteLine("");
             //dynamic dynObj = new ExpandoObject();
             //dynObj.Name = "名称";
             //dynObj.Text = "aaabc";
@@ -211,8 +221,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()
             ////{
@@ -728,7 +738,7 @@ namespace wispro.sp.winClient
             Stopwatch watch = new Stopwatch();
             watch.Start();
            
-            dynamic retObj = wispro.sp.utility.IPEasyUtility.GetPerformanctRecord("S2112392-洗碗机调查分析","提出报告");
+            dynamic retObj = wispro.sp.utility.IPEasyUtility.GetPerformanceRecord("S2112392-洗碗机调查分析","提出报告");
             PerformanceItem Item = new PerformanceItem();
             Item.CaseName = retObj.CaseName;
             Item.CaseNo = retObj.CaseNo;

+ 54 - 0
wospro.sp.entity/EmunHelper.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity
+{
+    public class EnumnDescription<T>
+    {
+        public string Description { get; set; }
+
+        public T Value { get; set; }
+    }
+
+    public class EnumHelper
+    {
+
+        /// <summary>
+        /// 将枚举转换成描述字典集合
+        /// </summary>
+        /// <typeparam name="T">枚举类型</typeparam>
+        /// <returns></returns>
+        public static List<EnumnDescription<T>> getEnumDescriptionDic<T>()
+        {
+            List<EnumnDescription<T>> resultList = new List<EnumnDescription<T>>();
+            Type type = typeof(T);
+            var strList = Enum.GetNames(typeof(T)).ToList();
+            foreach (string key in strList)
+            {
+                var obj = (T)Enum.Parse(type, key);
+                FieldInfo field = obj.GetType().GetField(obj.ToString());
+
+                DescriptionAttribute att = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute), false) as DescriptionAttribute;
+
+                if (att == null)
+                {
+                    resultList.Add(new EnumnDescription<T>() { Description = key, Value = obj });
+                }
+                else
+                {
+                    resultList.Add(new EnumnDescription<T>() { Description = att.Description, Value = obj });
+
+                }
+            }
+
+            return resultList;
+
+        }
+        
+    }
+}

+ 59 - 2
wospro.sp.entity/workflowDefine/ConditionTree.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -36,6 +37,7 @@ namespace wispro.sp.entity.workflowDefine
         public ConditionTreeNode Left { get; set; }
     }
 
+    #region 枚举类型
     public enum LogicSymbols
     {
         AND,
@@ -45,25 +47,67 @@ namespace wispro.sp.entity.workflowDefine
 
     public enum ComparisonSymbol
     {
+        [Description("包含")]
         Contains,
+        [Description("等于")]
         Equal,
+        [Description("大于")]
         Greater,
+        [Description("大于等于")]
         GreaterEqual,
+        [Description("小于")]
         Less,
+        [Description("小于等于")]
         LessEqual,
+        [Description("不等于")]
         NotEqual,
-        In,
-        Between,
+        //[Description("不等于")]
+        //In,
+        //[Description("不等于")]
+        //Between,
+        [Description("开头为")]
         StartsWith,
+        [Description("结尾为")]
         EndWith,
+        [Description("不包含")]
         NotContains
     }
 
+    public enum FieldType
+    {
+        [Description("用户输入值")]
+        ActionInputValue,
+        [Description("用户操作")]
+        DoAction,
+        [Description("绑定对象属性值")]
+        BindObjectProperty,
+        [Description("操作用户")]
+        DoActionUser
+
+    }
+
+    public enum UserType
+    {
+        [Description("指定用户")]
+        Staff,
+        [Description("指定部门")]
+        Department,
+        [Description("指定部门职位")]
+        DepartmentPosition,
+        [Description("指定操作处理人")]
+        DoActionUser,
+        [Description("绑定对象包含人员")]
+        BindObjectProperty
+    }
+    #endregion
+
     public class LogicNode : ConditionTreeNode
     {
         public LogicSymbols operate { get; set; }
     }
 
+    
+
     public class FieldNode : ConditionTreeNode
     {
         /// <summary>
@@ -83,5 +127,18 @@ namespace wispro.sp.entity.workflowDefine
         /// 比较符号
         /// </summary>
         public ComparisonSymbol Operator { get; set; }
+
+        /// <summary>
+        /// 类型
+        /// </summary>
+        public FieldType FieldType { get; set; }
+    }
+
+    
+    public class UserCondition
+    {
+        public UserType UserType { get; set; }
+
+        public string Value { get; set; }
     }
 }

+ 1 - 1
wospro.sp.entity/workflowDefine/EnmuFieldType.cs

@@ -13,7 +13,7 @@ namespace wispro.sp.entity.workflowDefine
         Text,
         [Description("数字")]
         Numberic,
-        [Description("日期")]
+        [Description("日期/时间")]
         Date,
         [Description("列表")]
         List

+ 27 - 0
wospro.sp.entity/workflowDefine/workflow.cs

@@ -29,6 +29,9 @@ namespace wispro.sp.entity.workflowDefine
         /// </summary>
         public int InitActionId { get; set; }
 
+        /// <summary>
+        /// 初始化Action
+        /// </summary>
         public Action InitAction { get; set; }
 
         /// <summary>
@@ -38,10 +41,34 @@ namespace wispro.sp.entity.workflowDefine
         /// </summary>
         public int EndStepId { get; set; }
 
+        /// <summary>
+        /// 创建日期
+        /// </summary>
         public DateTime CreateTime { get; set; }
 
+        /// <summary>
+        /// 创建人
+        /// </summary>
         public Staff CreateUser { get; set; }
 
+        /// <summary>
+        /// 创建人Id
+        /// </summary>
         public int CreateUserId { get; set; }
+
+        /// <summary>
+        /// 生效日期
+        /// </summary>
+        public DateTime EffectivrDate { get; set; }
+
+        /// <summary>
+        /// 失效日期
+        /// </summary>
+        public DateTime? ExpirationDate { get; set; }
+
+        /// <summary>
+        /// 说明
+        /// </summary>
+        public string Memo { get; set; }
     }
 }