Prechádzať zdrojové kódy

添加审核API代码

luocaiyang 3 rokov pred
rodič
commit
c439bce2da

+ 212 - 1
wispro.sp.api/Controllers/AppealController.cs

@@ -2,7 +2,9 @@
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
 using System;
+using System.Collections;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Threading.Tasks;
 using wispro.sp.entity;
@@ -34,6 +36,14 @@ namespace wispro.sp.api.Controllers
                 .ToList();
         }
 
+        /// <summary>
+        /// 创建申诉流程
+        /// </summary>
+        /// <param name="ItemId"></param>
+        /// <param name="typeid"></param>
+        /// <param name="reviewerId"></param>
+        /// <param name="appealObject"></param>
+        /// <returns></returns>
         public IActionResult CreateAppeal(int ItemId, int typeid, int reviewerId, AppealObject appealObject)
         {
             AppealRecord appealRecord = new AppealRecord();
@@ -74,9 +84,210 @@ namespace wispro.sp.api.Controllers
             }
         }
 
+        public IActionResult ReviewerAppeal(int appealRecordId,AppealObject appealObject)
+        {
+            var appealRecord = Context.AppealRecords.Where<AppealRecord>(p => p.Id == appealRecordId).FirstOrDefault();
+
+            if(appealRecord != null)
+            {
+                var t = Context.Database.BeginTransaction();
+                try
+                {
+                    appealRecord.ReviewerId = 5;// Context.Staffs.Where<Staff>(s => s.Name == User.Identity.Name).FirstOrDefault().Id;
+                    appealRecord.State = 1;
+                    appealRecord.ReviewTime = DateTime.Now;
+                    //Context.AppealRecords.Add(appealRecord);
+
+                    Context.SaveChanges();
+                    foreach (var fieldValue in appealObject.inputFieldValues)
+                    {
+                        fieldValue.InputField = null;
+                        fieldValue.AppealRecordId = appealRecord.Id;
+                    }
+                    Context.InputFieldValues.AddRange(appealObject.inputFieldValues);
+                    //throw (new ApplicationException("输入不能为空"));
+                    Context.SaveChanges();
+                    if (appealObject.attachFiles != null)
+                    {
+                        foreach (var file in appealObject.attachFiles)
+                        {
+                            var temFile = Context.AttachFiles.Where<AttachFile>(f => f.Id == file.Id).FirstOrDefault();
+                            temFile.AppealRecordId = appealRecord.Id;
+                        }
+                    }
+
+                    List<InputFieldValue> inputFieldValues = Context.InputFieldValues
+                        .Where<InputFieldValue>(p => p.AppealRecordId == appealRecordId
+                                    && p.InputField.MapObjectField != null)
+                        .Include(i=>i.InputField)
+                        .ToList();
+
+                    foreach(InputFieldValue inputFieldValue in inputFieldValues)
+                    {
+                        
+                        SaveValueToMapObject(appealRecord, inputFieldValue);
+                        
+                    }
+
+                    Context.SaveChanges();
+                    t.Commit();
+
+                    return Ok();
+                }
+                catch (Exception ex)
+                {
+                    t.Rollback();
+
+                    return BadRequest(ex.Message);
+                }
+            }
+            else
+            {
+                return BadRequest("申诉不存在!");
+            }
+            
+        }
+
+        private object ConvertSimpleType(object value, Type destinationType)
+        {
+            object returnValue;
+            if ((value == null) || destinationType.IsInstanceOfType(value))
+            {
+                return value;
+            }
+            string str = value as string;
+            if ((str != null) && (str.Length == 0))
+            {
+                return null;
+            }
+            TypeConverter converter = TypeDescriptor.GetConverter(destinationType);
+            bool flag = converter.CanConvertFrom(value.GetType());
+
+            if (!flag)
+            {
+                converter = TypeDescriptor.GetConverter(value.GetType());
+            }
+            if (!flag && !converter.CanConvertTo(destinationType))
+            {
+                throw new InvalidOperationException("无法转换成类型:" + value.ToString() + "==>" + destinationType);
+            }
+            try
+            {
+                returnValue = flag ? converter.ConvertFrom(null, null, value) : converter.ConvertTo(null, null, value, destinationType);
+            }
+            catch (Exception e)
+            {
+                throw new InvalidOperationException("类型转换出错:" + value.ToString() + "==>" + destinationType, e);
+            }
+            return returnValue;
+        }
+
+
+
+        private void SaveValueToMapObject(AppealRecord appealRecord, InputFieldValue inputFieldValue)
+        {
+            if (!string.IsNullOrEmpty(inputFieldValue.InputField.MapObjectField))
+            {
+                bool isSave = false;
+                if (!string.IsNullOrEmpty(inputFieldValue.InputField.MapSaveCondition))
+                {
+                    string[] conditions = inputFieldValue.InputField.MapSaveCondition.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
+
+                    if (conditions.Length == 1)
+                    {
+                        if (appealRecord.State == int.Parse(conditions[0]))
+                        {
+                            isSave = true;
+                        }
+                    }
+                    else
+                    {
+                        if (appealRecord.State == int.Parse(conditions[0]))
+                        {
+                            InputFieldValue temValue =
+                            Context.InputFieldValues.Where<InputFieldValue>(v =>
+                                v.AppealRecordId == appealRecord.Id &&
+                                v.InputField.Id == int.Parse(conditions[1]) &&
+                                v.Value == conditions[2])
+                            .FirstOrDefault();
+
+                            if (temValue != null)
+                            {
+                                isSave = true;
+                            }
+                        }
+                    }
+
+                }
+                else
+                {
+                    isSave = true;
+                }
+
+                if (isSave)
+                {
+                    InputField field = inputFieldValue.InputField;
+                    PerformanceItem Item = Context.PerformanceItems.Where<PerformanceItem>(p =>
+                        p.Id == appealRecord.ItemId)
+                        .Include(p => p.ItemStaffs).ThenInclude(it=>it.DoPerson)
+                        .Include(p => p.Reviewer)
+                        .FirstOrDefault();
+
+                    if (!string.IsNullOrEmpty(field.MapObjectField) && !string.IsNullOrEmpty(field.MapObjectFieldLabel))
+                    {
+                        List<InputFieldValue> temValues = new List<InputFieldValue>();
+                        string[] pList = field.MapObjectField.Split(new char[] { '.' });
+                        string[] plList = field.MapObjectFieldLabel.Split(new char[] { '.' });
+
+                        var pInfo = Item.GetType().GetProperty(pList[0]);
+
+                        var o = pInfo.GetValue(Item);
+
+
+                        if (Array.IndexOf(o.GetType().GetInterfaces(), typeof(IEnumerable)) > -1)
+                        {
+                            List<string> Values = new List<string>();
+                            List<string> Labels = new List<string>();
+
+                            var objList = o as IEnumerable;
+
+                            foreach (var obj in objList)
+                            {
+                                var objLabel = obj;
+                                for (int i = 1; i < plList.Length; i++)
+                                {
+                                    objLabel = objLabel.GetType().GetProperty(plList[i]).GetValue(objLabel);
+                                }
+
+                                if (objLabel.ToString() == inputFieldValue.Label)
+                                {
+                                    var objValue = obj;
+
+                                    for (int i = 1; i < pList.Length - 1; i++)
+                                    {
+                                        objValue = objValue.GetType().GetProperty(pList[i]).GetValue(objValue);
+                                    }
+
+                                    objValue.GetType().GetProperty(pList[pList.Length - 1])
+                                        .SetValue(objValue, ConvertSimpleType(inputFieldValue.Value,Type.GetType(inputFieldValue.InputField.FieldType)));
+                                }
+                            }
+                        }
+                        
+                    }
+                    else
+                    {
+                        Item.GetType().GetProperty(field.MapObjectField).SetValue(Item, ConvertSimpleType(inputFieldValue.Value, Type.GetType(inputFieldValue.InputField.FieldType)));
+
+                    }
+
+                }
+            }
+        }
+
         public List<AppealRecord> GetAppealRecords(int userId)
         {
-            var data = Context.AppealRecords.Where<AppealRecord>(ar => ar.CreaterId == userId || ar.ReviewerId == userId);
+            var data = Context.AppealRecords.Where<AppealRecord>(ar => ar.CreaterId == userId || (ar.ReviewerId == userId && ar.State !=1));
 
             return data.Include(p => p.Reviewer)
                 .Include(p => p.Creater)

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1748 - 0
wispro.sp.api/Migrations/20211115011112_addCaseCeoffcient.Designer.cs


+ 816 - 0
wispro.sp.api/Migrations/20211115011112_addCaseCeoffcient.cs

@@ -0,0 +1,816 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace wispro.sp.api.Migrations
+{
+    public partial class addCaseCeoffcient : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "AppealType",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    CanDoExpress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    ReviewerExpress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    Type = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_AppealType", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "BasePointRule",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Rule = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
+                    PointExpress = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
+                    Priority = table.Column<int>(type: "int", nullable: false),
+                    Type = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_BasePointRule", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "CalMonth",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    year = table.Column<int>(type: "int", nullable: false),
+                    month = table.Column<int>(type: "int", nullable: false),
+                    status = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_CalMonth", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "CaseCeofficient",
+                columns: table => new
+                {
+                    Ceoffcient = table.Column<string>(type: "nvarchar(450)", nullable: false),
+                    Value = table.Column<double>(type: "float", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_CaseCeofficient", x => x.Ceoffcient);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "StaffGrade",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Grade = table.Column<string>(type: "nchar(5)", fixedLength: true, maxLength: 5, nullable: false),
+                    Coefficient = table.Column<double>(type: "float", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_StaffGrade", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "InputField",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    FieldName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    FieldType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    MapObjectField = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    MapObjectFieldLabel = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    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)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_InputField", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_InputField_AppealType_AppealTypeId",
+                        column: x => x.AppealTypeId,
+                        principalTable: "AppealType",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Staff",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Account = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
+                    Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
+                    Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    IsOnJob = table.Column<bool>(type: "bit", nullable: false),
+                    Status = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: false),
+                    isCalPerformsnce = table.Column<bool>(type: "bit", nullable: false),
+                    StaffGradeId = table.Column<int>(type: "int", nullable: true),
+                    Department = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    WorkPlace = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    EntyDate = table.Column<DateTime>(type: "date", nullable: true),
+                    Mail = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Memo = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Staff", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Staff_StaffGrade",
+                        column: x => x.StaffGradeId,
+                        principalTable: "StaffGrade",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "VerifyCoefficient",
+                columns: table => new
+                {
+                    CheckerId = table.Column<int>(type: "int", nullable: false),
+                    DoPersonId = table.Column<int>(type: "int", nullable: false),
+                    Coefficient = table.Column<double>(type: "float", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_VerifyCoefficient", x => new { x.CheckerId, x.DoPersonId });
+                    table.ForeignKey(
+                        name: "FK_VerifyCoefficient_StaffGrade",
+                        column: x => x.CheckerId,
+                        principalTable: "StaffGrade",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_VerifyCoefficient_StaffGrade1",
+                        column: x => x.DoPersonId,
+                        principalTable: "StaffGrade",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "SelectValue",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Value = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    InputFieldId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_SelectValue", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_SelectValue_InputField_InputFieldId",
+                        column: x => x.InputFieldId,
+                        principalTable: "InputField",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Customer",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
+                    ContactMan = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    Address = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    Phone = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    ResponseManId = table.Column<int>(type: "int", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Customer", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Customer_Staff",
+                        column: x => x.ResponseManId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Message",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
+                    MessageInfo = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    Type = table.Column<int>(type: "int", nullable: false),
+                    FromId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Message", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_From_Staff",
+                        column: x => x.FromId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "PerformanceItem",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    CaseNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    ApplicationType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    BusinessType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    AgentFeedbackMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    DoItem = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    CaseStage = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    CaseCoefficient = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
+                    DoItemCoefficient = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    PreOAStaffId = table.Column<int>(type: "int", nullable: true),
+                    ReviewerId = table.Column<int>(type: "int", nullable: true),
+                    CustomerId = table.Column<int>(type: "int", nullable: true),
+                    ApplicationName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
+                    FinishedDate = table.Column<DateTime>(type: "date", nullable: true),
+                    FinalizationDate = table.Column<DateTime>(type: "date", nullable: true),
+                    ReturnDate = table.Column<DateTime>(type: "date", nullable: true),
+                    CaseType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    CaseState = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    DoItemMemo = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    DoItemState = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    CaseName = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    CustomerLimitDate = table.Column<DateTime>(type: "date", nullable: true),
+                    EntrustingDate = table.Column<DateTime>(type: "date", nullable: true),
+                    InternalDate = table.Column<DateTime>(type: "date", nullable: true),
+                    FirstDraftDate = table.Column<DateTime>(type: "date", nullable: true),
+                    OverDueMemo = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
+                    BasePoint = table.Column<decimal>(type: "numeric(18,2)", nullable: true),
+                    Status = table.Column<int>(type: "int", nullable: true),
+                    CaseMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    WordCount = table.Column<int>(type: "int", nullable: true),
+                    ReturnCasseNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Type = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    CalMonthId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_PerformanceItem", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_PerformanceItem_CalMonth",
+                        column: x => x.CalMonthId,
+                        principalTable: "CalMonth",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_PerformanceItem_Customer",
+                        column: x => x.CustomerId,
+                        principalTable: "Customer",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_PerformanceItem_Reviewer",
+                        column: x => x.ReviewerId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_PerformanceItem_Staff",
+                        column: x => x.PreOAStaffId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "MessageReadRecord",
+                columns: table => new
+                {
+                    MessageId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
+                    StaffId = table.Column<int>(type: "int", nullable: false),
+                    isReaded = table.Column<bool>(type: "bit", nullable: false),
+                    MessageId1 = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_MessageReadRecord", x => new { x.MessageId, x.StaffId });
+                    table.ForeignKey(
+                        name: "FK_MessageReadRecord_Message",
+                        column: x => x.MessageId,
+                        principalTable: "Message",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_MessageReadRecord_Message_MessageId1",
+                        column: x => x.MessageId1,
+                        principalTable: "Message",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_MessageReadRecord_Staff",
+                        column: x => x.StaffId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "AppealRecord",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    CreaterId = table.Column<int>(type: "int", nullable: false),
+                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    Reason = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    State = table.Column<int>(type: "int", nullable: false),
+                    ReviewerId = table.Column<int>(type: "int", nullable: true),
+                    ReviewerMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ReviewTime = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    TypeId = table.Column<int>(type: "int", nullable: false),
+                    ItemId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_AppealRecord", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_AppealRecord_AppealType_TypeId",
+                        column: x => x.TypeId,
+                        principalTable: "AppealType",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_AppealRecord_PerformanceItem_ItemId",
+                        column: x => x.ItemId,
+                        principalTable: "PerformanceItem",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_AppealRecord_Staff_CreaterId",
+                        column: x => x.CreaterId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_AppealRecord_Staff_ReviewerId",
+                        column: x => x.ReviewerId,
+                        principalTable: "Staff",
+                        principalColumn: "Id");
+                });
+
+            migrationBuilder.CreateTable(
+                name: "ItemStaff",
+                columns: table => new
+                {
+                    ItemId = table.Column<int>(type: "int", nullable: false),
+                    DoPersonId = table.Column<int>(type: "int", nullable: false),
+                    PerformancePoint = table.Column<double>(type: "float", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ItemStaff", x => new { x.ItemId, x.DoPersonId });
+                    table.ForeignKey(
+                        name: "FK_ItemStaff_PerformanceItem",
+                        column: x => x.ItemId,
+                        principalTable: "PerformanceItem",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_ItemStaff_Staff",
+                        column: x => x.DoPersonId,
+                        principalTable: "Staff",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "MessagePerformanceItems",
+                columns: table => new
+                {
+                    MessageId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
+                    ItemId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_MessagePerformanceItems", x => new { x.ItemId, x.MessageId });
+                    table.ForeignKey(
+                        name: "FK_MessagePerformanceItem_Item",
+                        column: x => x.ItemId,
+                        principalTable: "PerformanceItem",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_MessagePerformanceItem_Message",
+                        column: x => x.MessageId,
+                        principalTable: "Message",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "AttachFile",
+                columns: table => new
+                {
+                    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),
+                    AppealRecordId = table.Column<int>(type: "int", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_AttachFile", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_AttachFile_AppealRecord",
+                        column: x => x.AppealRecordId,
+                        principalTable: "AppealRecord",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Restrict);
+                    table.ForeignKey(
+                        name: "FK_AttachFile_UpdateUser",
+                        column: x => x.UploadUserId,
+                        principalTable: "Staff",
+                        principalColumn: "Id");
+                });
+
+            migrationBuilder.CreateTable(
+                name: "InputFieldValue",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    InputFieldId = table.Column<int>(type: "int", nullable: false),
+                    Label = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Value = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    AppealRecordId = table.Column<int>(type: "int", nullable: false),
+                    mapExpress = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_InputFieldValue", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_InputFieldValue_AppealRecord_AppealRecordId",
+                        column: x => x.AppealRecordId,
+                        principalTable: "AppealRecord",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_InputFieldValue_InputField_InputFieldId",
+                        column: x => x.InputFieldId,
+                        principalTable: "InputField",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.InsertData(
+                table: "AppealType",
+                columns: new[] { "Id", "CanDoExpress", "Name", "ReviewerExpress", "Type" },
+                values: new object[,]
+                {
+                    { 1, "p.ItemStaffs.Count()>1", "绩效点数分配比率", null, 0 },
+                    { 2, "p.DoItem==\"新申请\"", "案件系数复核", "p.Reviewer", 0 },
+                    { 3, "p.DoItem==\"新申请\"", "处理事项系数复核", "p.Reviewer", 0 },
+                    { 4, "", "案件缺漏申诉", "p.Reviewer", 1 },
+                    { 5, "p.isDanger()", "案件严重超期说明", null, 0 },
+                    { 6, "p.DoItem==\"新申请\" || p.DoItem==\"翻译\"", "按照翻译字数算绩效备注", null, 0 }
+                });
+
+            migrationBuilder.InsertData(
+                table: "CaseCeofficient",
+                columns: new[] { "Ceoffcient", "Value" },
+                values: new object[,]
+                {
+                    { "D", 0.40000000000000002 },
+                    { "C", 0.69999999999999996 },
+                    { "B", 1.0 },
+                    { "A", 1.5 },
+                    { "S", 2.5 }
+                });
+
+            migrationBuilder.InsertData(
+                table: "StaffGrade",
+                columns: new[] { "Id", "Coefficient", "Grade" },
+                values: new object[,]
+                {
+                    { 14, 1.1000000000000001, "A级" },
+                    { 13, 0.5, "D1级" },
+                    { 12, 0.59999999999999998, "D2级" },
+                    { 11, 0.59999999999999998, "D3级" },
+                    { 10, 0.69999999999999996, "C1级" },
+                    { 9, 0.69999999999999996, "C2级" },
+                    { 8, 0.90000000000000002, "C3级" },
+                    { 3, 1.1000000000000001, "A2级" },
+                    { 6, 1.0, "B2级" },
+                    { 5, 1.0, "B3级" },
+                    { 4, 1.1000000000000001, "A1级" },
+                    { 15, 1.0, "C级" },
+                    { 2, 1.1000000000000001, "A3级" },
+                    { 1, 1.2, "S级" },
+                    { 7, 0.90000000000000002, "B1级" },
+                    { 16, 0.90000000000000002, "D级" }
+                });
+
+            migrationBuilder.InsertData(
+                table: "InputField",
+                columns: new[] { "Id", "AppealState", "AppealTypeId", "CanMuliSelect", "FieldName", "FieldType", "MapObjectField", "MapObjectFieldLabel", "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 }
+                });
+
+            migrationBuilder.InsertData(
+                table: "VerifyCoefficient",
+                columns: new[] { "CheckerId", "DoPersonId", "Coefficient" },
+                values: new object[,]
+                {
+                    { 2, 11, 0.40000000000000002 },
+                    { 1, 11, 0.5 },
+                    { 6, 10, 0.29999999999999999 },
+                    { 5, 10, 0.29999999999999999 },
+                    { 4, 10, 0.29999999999999999 },
+                    { 5, 9, 0.29999999999999999 },
+                    { 2, 10, 0.29999999999999999 },
+                    { 1, 10, 0.40000000000000002 },
+                    { 6, 9, 0.29999999999999999 },
+                    { 3, 11, 0.40000000000000002 },
+                    { 3, 10, 0.29999999999999999 },
+                    { 4, 11, 0.40000000000000002 },
+                    { 2, 13, 0.5 },
+                    { 6, 11, 0.40000000000000002 },
+                    { 1, 12, 0.5 },
+                    { 2, 12, 0.40000000000000002 },
+                    { 3, 12, 0.40000000000000002 },
+                    { 4, 12, 0.40000000000000002 },
+                    { 5, 12, 0.40000000000000002 },
+                    { 6, 12, 0.40000000000000002 },
+                    { 1, 13, 0.59999999999999998 }
+                });
+
+            migrationBuilder.InsertData(
+                table: "VerifyCoefficient",
+                columns: new[] { "CheckerId", "DoPersonId", "Coefficient" },
+                values: new object[,]
+                {
+                    { 4, 9, 0.29999999999999999 },
+                    { 3, 13, 0.5 },
+                    { 4, 13, 0.5 },
+                    { 5, 11, 0.40000000000000002 },
+                    { 3, 9, 0.29999999999999999 },
+                    { 5, 7, 0.20000000000000001 },
+                    { 1, 9, 0.40000000000000002 },
+                    { 1, 5, 0.29999999999999999 },
+                    { 2, 5, 0.20000000000000001 },
+                    { 3, 5, 0.20000000000000001 },
+                    { 4, 5, 0.20000000000000001 },
+                    { 5, 5, 0.20000000000000001 },
+                    { 1, 6, 0.29999999999999999 },
+                    { 2, 6, 0.20000000000000001 },
+                    { 3, 6, 0.20000000000000001 },
+                    { 4, 6, 0.20000000000000001 },
+                    { 5, 6, 0.20000000000000001 },
+                    { 6, 5, 0.20000000000000001 },
+                    { 2, 9, 0.29999999999999999 },
+                    { 6, 6, 0.20000000000000001 },
+                    { 2, 7, 0.20000000000000001 },
+                    { 3, 7, 0.20000000000000001 },
+                    { 4, 7, 0.20000000000000001 },
+                    { 5, 13, 0.5 },
+                    { 6, 7, 0.20000000000000001 },
+                    { 1, 8, 0.29999999999999999 },
+                    { 2, 8, 0.20000000000000001 },
+                    { 3, 8, 0.20000000000000001 },
+                    { 4, 8, 0.20000000000000001 },
+                    { 5, 8, 0.20000000000000001 },
+                    { 6, 8, 0.20000000000000001 },
+                    { 1, 7, 0.29999999999999999 },
+                    { 6, 13, 0.5 }
+                });
+
+            migrationBuilder.InsertData(
+                table: "SelectValue",
+                columns: new[] { "Id", "InputFieldId", "Value" },
+                values: new object[,]
+                {
+                    { 1, 5, "同意" },
+                    { 16, 19, "中-德" },
+                    { 20, 22, "拒绝" },
+                    { 19, 22, "同意" },
+                    { 8, 17, "拒绝" },
+                    { 7, 17, "同意" },
+                    { 6, 13, "拒绝" },
+                    { 5, 13, "同意" },
+                    { 15, 11, "形式" },
+                    { 14, 11, "实质" },
+                    { 4, 10, "拒绝" },
+                    { 3, 10, "同意" },
+                    { 13, 6, "D" },
+                    { 12, 6, "C" },
+                    { 11, 6, "B" },
+                    { 10, 6, "A" },
+                    { 9, 6, "S" },
+                    { 2, 5, "拒绝" },
+                    { 17, 19, "中-英" },
+                    { 18, 19, "英-中" }
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AppealRecord_CreaterId",
+                table: "AppealRecord",
+                column: "CreaterId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AppealRecord_ItemId",
+                table: "AppealRecord",
+                column: "ItemId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AppealRecord_ReviewerId",
+                table: "AppealRecord",
+                column: "ReviewerId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AppealRecord_TypeId",
+                table: "AppealRecord",
+                column: "TypeId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AttachFile_AppealRecordId",
+                table: "AttachFile",
+                column: "AppealRecordId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AttachFile_UploadUserId",
+                table: "AttachFile",
+                column: "UploadUserId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Customer_ResponseManId",
+                table: "Customer",
+                column: "ResponseManId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_InputField_AppealTypeId",
+                table: "InputField",
+                column: "AppealTypeId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_InputFieldValue_AppealRecordId",
+                table: "InputFieldValue",
+                column: "AppealRecordId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_InputFieldValue_InputFieldId",
+                table: "InputFieldValue",
+                column: "InputFieldId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ItemStaff_DoPersonId",
+                table: "ItemStaff",
+                column: "DoPersonId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Message_FromId",
+                table: "Message",
+                column: "FromId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_MessagePerformanceItems_MessageId",
+                table: "MessagePerformanceItems",
+                column: "MessageId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_MessageReadRecord_MessageId1",
+                table: "MessageReadRecord",
+                column: "MessageId1");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_MessageReadRecord_StaffId",
+                table: "MessageReadRecord",
+                column: "StaffId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PerformanceItem_CalMonthId",
+                table: "PerformanceItem",
+                column: "CalMonthId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PerformanceItem_CustomerId",
+                table: "PerformanceItem",
+                column: "CustomerId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PerformanceItem_PreOAStaffId",
+                table: "PerformanceItem",
+                column: "PreOAStaffId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PerformanceItem_ReviewerId",
+                table: "PerformanceItem",
+                column: "ReviewerId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_SelectValue_InputFieldId",
+                table: "SelectValue",
+                column: "InputFieldId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Staff_StaffGradeId",
+                table: "Staff",
+                column: "StaffGradeId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_VerifyCoefficient_DoPersonId",
+                table: "VerifyCoefficient",
+                column: "DoPersonId");
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "AttachFile");
+
+            migrationBuilder.DropTable(
+                name: "BasePointRule");
+
+            migrationBuilder.DropTable(
+                name: "CaseCeofficient");
+
+            migrationBuilder.DropTable(
+                name: "InputFieldValue");
+
+            migrationBuilder.DropTable(
+                name: "ItemStaff");
+
+            migrationBuilder.DropTable(
+                name: "MessagePerformanceItems");
+
+            migrationBuilder.DropTable(
+                name: "MessageReadRecord");
+
+            migrationBuilder.DropTable(
+                name: "SelectValue");
+
+            migrationBuilder.DropTable(
+                name: "VerifyCoefficient");
+
+            migrationBuilder.DropTable(
+                name: "AppealRecord");
+
+            migrationBuilder.DropTable(
+                name: "Message");
+
+            migrationBuilder.DropTable(
+                name: "InputField");
+
+            migrationBuilder.DropTable(
+                name: "PerformanceItem");
+
+            migrationBuilder.DropTable(
+                name: "AppealType");
+
+            migrationBuilder.DropTable(
+                name: "CalMonth");
+
+            migrationBuilder.DropTable(
+                name: "Customer");
+
+            migrationBuilder.DropTable(
+                name: "Staff");
+
+            migrationBuilder.DropTable(
+                name: "StaffGrade");
+        }
+    }
+}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1746 - 0
wispro.sp.api/Migrations/spDbContextModelSnapshot.cs


+ 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 15 * * ? *"
+    "ScheduleSetting": "00 16 01 1 * ? *"
   },
 
   "MailSetting": {

+ 27 - 3
wispro.sp.api/spDbContext.cs

@@ -47,6 +47,8 @@ namespace wispro.sp.api
 
         public virtual DbSet<SelectValue> SelectValues { get; set; }
 
+        public virtual DbSet<CaseCeoffcient> CaseCeoffcients { get; set; }
+
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             if (!optionsBuilder.IsConfigured)
@@ -58,6 +60,12 @@ namespace wispro.sp.api
 
         protected override void OnModelCreating(ModelBuilder modelBuilder)
         {
+            modelBuilder.Entity<CaseCeoffcient>( entity=>
+            {
+                entity.ToTable("CaseCeofficient");
+
+                entity.HasKey(e=>e.Ceoffcient);
+            });
             modelBuilder.Entity<BasePointRule>(entity=> {
                 entity.ToTable("BasePointRule");
 
@@ -559,9 +567,13 @@ namespace wispro.sp.api
                 new InputField(){Id=17,AppealTypeId =4,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
                  
                 new InputField(){Id=18,AppealTypeId =5,AppealState =0,FieldName ="超期说明",MapObjectField ="OverDueMemo", FieldType = typeof(string).ToString() },
-                
+                new InputField(){Id=21,AppealTypeId =5,AppealState =1,FieldName ="审核意见", FieldType = typeof(string).ToString() },
+                new InputField(){Id=22,AppealTypeId =5,AppealState =1,FieldName ="备注", FieldType = typeof(string).ToString() },
+
                 new InputField(){Id=19,AppealTypeId =6,AppealState =0,FieldName ="翻译类型", MapObjectField ="AgentFeedbackMemo", FieldType = typeof(string).ToString() },
-                new InputField(){Id=20,AppealTypeId =6,AppealState =0,FieldName ="翻译字数",  FieldType = typeof(int).ToString() },
+                new InputField(){Id=20,AppealTypeId =6,AppealState =0,FieldName ="翻译字数", MapObjectField ="WordCount", FieldType = typeof(int).ToString() },
+                new InputField(){Id=23,AppealTypeId =6,AppealState =1,FieldName ="审核意见",  FieldType = typeof(int).ToString() },
+                new InputField(){Id=24,AppealTypeId =6,AppealState =1,FieldName ="翻译字数", MapObjectField ="WordCount", FieldType = typeof(int).ToString() },
 
             };
 
@@ -586,12 +598,24 @@ namespace wispro.sp.api
 
                 new SelectValue(){Id =16, InputFieldId =19, Value ="中-德" },
                 new SelectValue(){Id =17, InputFieldId =19, Value ="中-英" },
-                new SelectValue(){Id =18, InputFieldId =19, Value ="英-中" }
+                new SelectValue(){Id =18, InputFieldId =19, Value ="英-中" },
+
+                new SelectValue(){Id =19, InputFieldId =22, Value ="同意" },
+                new SelectValue(){Id =20, InputFieldId =22, Value ="拒绝" },
             };
 
+            List<CaseCeoffcient> caseCeoffcients = new List<CaseCeoffcient>()
+            {
+                new CaseCeoffcient(){ Ceoffcient="S",Value =2.5},
+                new CaseCeoffcient(){ Ceoffcient="A",Value =1.5},
+                new CaseCeoffcient(){ Ceoffcient="B",Value =1.0},
+                new CaseCeoffcient(){ Ceoffcient="C",Value =0.7},
+                new CaseCeoffcient(){ Ceoffcient="D",Value =0.4}
+            };
             modelBuilder.Entity<AppealType>().HasData(appealTypes);
             modelBuilder.Entity<InputField>().HasData(inputFields);
             modelBuilder.Entity<SelectValue>().HasData(selectValues);
+            modelBuilder.Entity<CaseCeoffcient>().HasData(caseCeoffcients);
 
             OnModelCreatingPartial(modelBuilder);
         }

+ 1 - 11
wispro.sp.web/Components/CreateAppeal.razor

@@ -136,17 +136,7 @@
     
 </Card>
 <Divider />
-@*<div>
-    <Row>
-        <AntDesign.Col Span="8" Offset="18">
-            <Space>
-                <SpaceItem><Button OnClick="@OnFinish" Type="@ButtonType.Primary">提交</Button></SpaceItem>
-                <SpaceItem><Button OnClick="@OnCancel" Danger>取消</Button></SpaceItem>
-            </Space>
-        </AntDesign.Col>
-    </Row>
-        
-</div>*@
+
 
 
 

+ 7 - 3
wispro.sp.web/Pages/Welcome.razor

@@ -49,7 +49,7 @@
                              Size="large"
                              ItemLayout="ListItemLayout.Horizontal"
                              >
-                        <ListItem OnClick="() => ShowModel(context)">
+                        <ListItem>
                             <ListItemMeta Avatar="@context.Creater.Name" Description="@(context.ReviewTime.HasValue?context.ReviewTime.Value.ToFriendlyDisplay():context.CreateTime.ToFriendlyDisplay())">
                                 <TitleTemplate>
                                     <span>
@@ -61,7 +61,11 @@
                                                     <span>(@context.Reviewer.Name 在 @context.ReviewTime.Value.ToFriendlyDisplay() 审核了你提交的 @context.Item.CaseNo @context.Type.Name")</span> }
                                                 else
                                                 {
-                                                    <span>(您在 @context.CreateTime.ToFriendlyDisplay()提交的@context.Item.CaseNo @context.Type.Name,@context.Reviewer.Name 已于 @context.ReviewTime.Value.ToFriendlyDisplay() 审核完成"</span> }
+                                                    if (context.ReviewerId != _CurrentUser.Userid)
+                                                    {
+                                                    <span>(您在 @context.CreateTime.ToFriendlyDisplay()提交的 @context.Item.CaseNo @context.Type.Name,@context.Reviewer.Name 已于 @context.ReviewTime.Value.ToFriendlyDisplay() 审核完成"</span> 
+                                                    }
+                                                }
                                             }
                                             else
                                             {
@@ -70,7 +74,7 @@
                                                     <span>您在 @context.CreateTime.ToFriendlyDisplay() 提交的 @context.Item.CaseNo @context.Type.Name ,正在等待 @context.Reviewer.Name 审核!"</span>}
                                                 else
                                                 {
-                                                    <span>@context.Creater.Name 在 @context.CreateTime.ToFriendlyDisplay() 提交的 @context.Item.CaseNo @context.Type.Name ,请您尽快<a href="/appeal/reviewer/@context.Id">审核</a>! </span>
+                                                    <span>@context.Creater.Name 在 @context.CreateTime.ToFriendlyDisplay() 提交的 @context.Item.CaseNo @context.Type.Name ,请您尽快<Button Danger Type="@ButtonType.Link" OnClick="()=>ShowModel(context)">审核</Button>!</span>
                                                 }
                                                                                 
                                             }

+ 37 - 0
wispro.sp.web/Pages/Welcome.razor.cs

@@ -34,6 +34,8 @@ namespace wispro.sp.web.Pages
         [Inject] protected AppealTypeService _atService { get; set; }
         private ModalRef _modalRef;
         [Inject] ModalService _ModalService { get; set; }
+
+        [Inject] MessageService _msgService { get; set; }
         
 
         protected override async System.Threading.Tasks.Task OnInitializedAsync()
@@ -94,11 +96,46 @@ namespace wispro.sp.web.Pages
                 try
                 {
                     await _atService.ReviewerAppeal(templateOptions);
+
                     await _modalRef.CloseAsync();
 
+                    AppealRecords = await _atService.GetUserAppeals(_CurrentUser.Userid);
+                    AppealRecords.Sort((a, b) =>
+                    {
+                        var sd = (a.ReviewTime == null) ? a.ReviewTime : a.CreateTime;
+                        var ed = (b.ReviewTime == null) ? b.ReviewTime : b.CreateTime;
+
+                        if (ed > sd)
+                        {
+                            return 1;
+                        }
+                        else
+                        {
+                            return -1;
+                        }
+
+                    });
+
+                    StateHasChanged();
+
+                    var SuccessConfig = new ConfirmOptions()
+                    {
+                        Content = @"审核成功!"
+                    };
+
+                    //modalConfig.Footer = null;
+                    modalConfig.DestroyOnClose = true;
+                    _ModalService.Success(SuccessConfig);
+                    
+
                 }
                 catch (Exception ex)
                 {
+                    _ModalService.Error(new ConfirmOptions()
+                    {
+                        Title = "审核错误",
+                        Content = ex.Message,
+                    });
                     //_ErrorMessage = ex.Message;
                 }
 

+ 6 - 2
wispro.sp.web/Services/AppealTypeService.cs

@@ -137,7 +137,7 @@ namespace wispro.sp.web.Services
         public async Task ReviewerAppeal(ReviewerAppealModel model)
         {
 
-            string strUrl = $"http://localhost:39476/api/Appeal/CreateAppeal?ItemId={model.Item.Id}&typeid={model.AppealType.Id}&reviewerId={model.AppealRecord.ReviewerId}";
+            string strUrl = $"http://localhost:39476/api/Appeal/ReviewerAppeal?appealRecordId={model.AppealRecord.Id}";
             AppealObject appealObject = new AppealObject();
             appealObject.inputFieldValues = model.inputFieldValues;
 
@@ -148,7 +148,11 @@ namespace wispro.sp.web.Services
 
             var data = await _httpClient.PostAsJsonAsync<AppealObject>(strUrl, appealObject);
 
-            Console.WriteLine(JsonSerializer.Serialize(data));
+            if (!data.IsSuccessStatusCode)
+            {
+                string strContent = await data.Content.ReadAsStringAsync();
+                throw new Exception(strContent);
+            }
         }
         
         

+ 24 - 0
wospro.sp.entity/CaseCeoffcient.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity
+{
+    /// <summary>
+    /// 案件系数
+    /// </summary>
+    public class CaseCeoffcient
+    {
+        /// <summary>
+        /// 案件系数
+        /// </summary>
+        public string Ceoffcient { get; set; }
+
+        /// <summary>
+        /// 系数值
+        /// </summary>
+        public double Value { get; set; }
+    }
+}

+ 8 - 0
wospro.sp.entity/InputField.cs

@@ -55,6 +55,14 @@ namespace wispro.sp.entity
         public virtual List<SelectValue> SelectValues { get; set; }
 
         public int? MaxSize { get; set; }
+
+        /// <summary>
+        /// 映射栏位保存到映射对象的条件
+        /// 为null时及时保存
+        /// 条件规则为:步骤:栏位:值
+        /// 表示在那个步骤的栏位==值时保存
+        /// </summary>
+        public string MapSaveCondition { get; set; }
     }
    
 }