Jelajahi Sumber

修改附件表映射Bug,添加自动生成申诉界面代码

luocaiyang 3 tahun lalu
induk
melakukan
788c302208

+ 30 - 15
wispro.sp.api/Controllers/AttachFilesController.cs

@@ -8,6 +8,7 @@ using System.IO;
 using System.Linq;
 using System.Net;
 using System.Threading.Tasks;
+using wispro.sp.entity;
 using wispro.sp.share;
 
 namespace wispro.sp.api.Controllers
@@ -18,31 +19,40 @@ namespace wispro.sp.api.Controllers
     {
         private readonly IWebHostEnvironment env;
         private readonly ILogger<AttachFilesController> logger;
+        private readonly spDbContext Context;
 
         public AttachFilesController(IWebHostEnvironment env,
-            ILogger<AttachFilesController> logger)
+            ILogger<AttachFilesController> logger,spDbContext context)
         {
             this.env = env;
             this.logger = logger;
+            this.Context = context;
         }
 
         [HttpPost]
-        public async Task<ActionResult<IList<UploadResult>>> PostFile(
+        public async Task<ActionResult<IList<AttachFile>>> PostFile(
         [FromForm] IEnumerable<IFormFile> files)
         {
-            
             var maxAllowedFiles = 3;
             long maxFileSize = 1024 * 1024 * 15;
             var filesProcessed = 0;
             var resourcePath = new Uri($"{Request.Scheme}://{Request.Host}/");
-            List<UploadResult> uploadResults = new();
+            List<AttachFile> uploadResults = new();
 
             foreach (var file in files)
             {
-                var uploadResult = new UploadResult();
+                var attachFile = new AttachFile();
                 string trustedFileNameForFileStorage;
                 var untrustedFileName = file.FileName;
-                uploadResult.FileName = untrustedFileName;
+                attachFile.Name  = untrustedFileName;
+
+                Staff uploadUser = Context.Staffs.Where<Staff>(s => s.Name == "何倚雯").FirstOrDefault();
+
+                if (uploadUser != null)
+                {
+                    attachFile.UploadUserId = uploadUser.Id;
+                }
+
                 var trustedFileNameForDisplay =
                     WebUtility.HtmlEncode(untrustedFileName);
 
@@ -52,37 +62,42 @@ namespace wispro.sp.api.Controllers
                     {
                         logger.LogInformation("{FileName} length is 0 (Err: 1)",
                             trustedFileNameForDisplay);
-                        uploadResult.ErrorCode = 1;
+                        //uploadResult.ErrorCode = 1;
                     }
                     else if (file.Length > maxFileSize)
                     {
                         logger.LogInformation("{FileName} of {Length} bytes is " +
                             "larger than the limit of {Limit} bytes (Err: 2)",
                             trustedFileNameForDisplay, file.Length, maxFileSize);
-                        uploadResult.ErrorCode = 2;
+                        //uploadResult.ErrorCode = 2;
                     }
                     else
                     {
                         try
                         {
                             trustedFileNameForFileStorage = Path.GetRandomFileName();
-                            var path = Path.Combine(env.ContentRootPath,
-                                env.EnvironmentName, "unsafe_uploads",
+
+                            var attachfileSavePath = utility.ConfigHelper.GetSectionValue("AttachFileSavePath");
+                            var path = Path.Combine(attachfileSavePath,                                
                                 trustedFileNameForFileStorage);
 
                             await using FileStream fs = new(path, FileMode.Create);
                             await file.CopyToAsync(fs);
+                            attachFile.SavePath = path;
 
                             logger.LogInformation("{FileName} saved at {Path}",
                                 trustedFileNameForDisplay, path);
-                            uploadResult.Uploaded = true;
-                            uploadResult.StoredFileName = trustedFileNameForFileStorage;
+
+                            Context.AttachFiles.Add(attachFile);
+                            Context.SaveChanges();
+                            //uploadResult.Uploaded = true;
+                            //uploadResult.StoredFileName = trustedFileNameForFileStorage;
                         }
                         catch (IOException ex)
                         {
                             logger.LogError("{FileName} error on upload (Err: 3): {Message}",
                                 trustedFileNameForDisplay, ex.Message);
-                            uploadResult.ErrorCode = 3;
+                            //uploadResult.ErrorCode = 3;
                         }
                     }
 
@@ -93,10 +108,10 @@ namespace wispro.sp.api.Controllers
                     logger.LogInformation("{FileName} not uploaded because the " +
                         "request exceeded the allowed {Count} of files (Err: 4)",
                         trustedFileNameForDisplay, maxAllowedFiles);
-                    uploadResult.ErrorCode = 4;
+                    //uploadResult.ErrorCode = 4;
                 }
 
-                uploadResults.Add(uploadResult);
+                uploadResults.Add(attachFile);
             }
 
             return new CreatedResult(resourcePath, uploadResults);

TEMPAT SAMPAH
wispro.sp.api/Development/unsafe_uploads/3zsyyrvx.fms


TEMPAT SAMPAH
wispro.sp.api/Development/unsafe_uploads/avzf3xwm.q05


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

@@ -14,6 +14,7 @@
 
   "ValidAudience": "StaffPerformance",
   "ValidIssuer": "http://localhost:39476",
+  "AttachFileSavePath": "c:\\temp",
 
   "jwt": {
     "Key": "fef3d2e1Edwfw43312321edszaSd",
@@ -26,7 +27,7 @@
     "Account": "caiyangl",
     "Password": "j)wx*lier*@3",
     "ChormeDriverPath": "D:\\source\\repos\\ConsoleApp2\\ConsoleApp2\\bin\\Debug",
-    "ScheduleSetting": "00 03 11 * * ? *"
+    "ScheduleSetting": "00 16 15 * * ? *"
   },
 
   "MailSetting": {

+ 33 - 9
wispro.sp.api/spDbContext.cs

@@ -328,9 +328,10 @@ namespace wispro.sp.api
                     .OnDelete(DeleteBehavior.NoAction);
 
                 entity.HasOne(d => d.AppealRecord)
-                    .WithMany()
+                    .WithMany(a=>a.AttachFiles)
                     .HasForeignKey(d => d.AppealRecordId)
-                    .HasConstraintName("FK_AttachFile_AppealRecord");
+                    .HasConstraintName("FK_AttachFile_AppealRecord")
+                    .IsRequired(false); 
             });
 
             modelBuilder.Entity<AppealType>(entity =>
@@ -361,6 +362,9 @@ namespace wispro.sp.api
                     .OnDelete(DeleteBehavior.NoAction)
                     .HasForeignKey(d => d.TypeId);
 
+                entity.HasOne(d => d.Item)
+                    .WithMany()
+                    .HasForeignKey(d=>d.ItemId);
             }) ;
 
             modelBuilder.Entity<InputField>(entity=> {
@@ -525,7 +529,8 @@ namespace wispro.sp.api
                 new AppealType(){Id=2,Name ="案件系数复核",CanDoExpress = "p.DoItem==\"新申请\"",ReviewerExpress ="p.Reviewer"},
                 new AppealType(){Id=3,Name ="处理事项系数复核",CanDoExpress = "p.DoItem==\"新申请\"",ReviewerExpress ="p.Reviewer"},
                 new AppealType(){Id=4,Name ="案件缺漏申诉",CanDoExpress ="",ReviewerExpress ="p.Reviewer",Type =1},
-                new AppealType(){Id=5,Name ="案件严重超期说明",CanDoExpress ="p.isDanger()"}
+                new AppealType(){Id=5,Name ="案件严重超期说明",CanDoExpress ="p.isDanger()"},
+                new AppealType(){Id=6,Name ="按照翻译字数算绩效备注",CanDoExpress ="p.DoItem==\"新申请\" || p.DoItem==\"翻译\""}
             };
 
             InputField[] inputFields = new InputField[] {
@@ -536,19 +541,25 @@ namespace wispro.sp.api
                 new InputField(){Id=5,AppealTypeId =1,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
 
                 
-                new InputField(){Id=6,AppealTypeId =2,AppealState =0,FieldName ="案件系数", MapObjectField ="CaseCoefficient",FieldType = typeof(double).ToString() },
+                new InputField(){Id=6,AppealTypeId =2,AppealState =0,FieldName ="案件系数", MapObjectField ="CaseCoefficient",FieldType = typeof(string).ToString() },
                 new InputField(){Id=9,AppealTypeId =2,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
                 new InputField(){Id=10,AppealTypeId =2,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
 
 
-                new InputField(){Id=11,AppealTypeId =3,AppealState =0,FieldName ="处理事项系数", MapObjectField ="DoItemCoefficient",FieldType = typeof(double).ToString() },
+                new InputField(){Id=11,AppealTypeId =3,AppealState =0,FieldName ="处理事项系数", MapObjectField ="DoItemCoefficient",FieldType = typeof(string).ToString() },
                 new InputField(){Id=12,AppealTypeId =3,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
                 new InputField(){Id=13,AppealTypeId =3,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
 
-                new InputField(){Id=14,AppealTypeId =4,AppealState =0,FieldName ="我方文号", FieldType = typeof(double).ToString() },
-                new InputField(){Id=15,AppealTypeId =4,AppealState =0,FieldName ="处理事项", FieldType = typeof(double).ToString() },
+                new InputField(){Id=14,AppealTypeId =4,AppealState =0,FieldName ="我方文号", FieldType = typeof(string).ToString() },
+                new InputField(){Id=15,AppealTypeId =4,AppealState =0,FieldName ="处理事项", FieldType = typeof(string).ToString() },
                 new InputField(){Id=16,AppealTypeId =4,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
-                new InputField(){Id=17,AppealTypeId =4,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()}
+                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=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() },
+
             };
 
             List<SelectValue> selectValues = new List<SelectValue>() {
@@ -559,7 +570,20 @@ namespace wispro.sp.api
                 new SelectValue(){Id =5, InputFieldId =13, Value ="同意" },
                 new SelectValue(){Id =6, InputFieldId =13, Value ="拒绝" },
                 new SelectValue(){Id =7, InputFieldId =17, Value ="同意" },
-                new SelectValue(){Id =8, InputFieldId =17, Value ="拒绝" }
+                new SelectValue(){Id =8, InputFieldId =17, Value ="拒绝" },
+
+                new SelectValue(){Id =9, InputFieldId =6, Value ="S" },
+                new SelectValue(){Id =10, InputFieldId =6, Value ="A" },
+                new SelectValue(){Id =11, InputFieldId =6, Value ="B" },
+                new SelectValue(){Id =12, InputFieldId =6, Value ="C" },
+                new SelectValue(){Id =13, InputFieldId =6, Value ="D" },
+
+                new SelectValue(){Id =14, InputFieldId =11, Value ="实质" },
+                new SelectValue(){Id =15, InputFieldId =11, Value ="形式" },
+
+                new SelectValue(){Id =16, InputFieldId =19, Value ="中-德" },
+                new SelectValue(){Id =17, InputFieldId =19, Value ="中-英" },
+                new SelectValue(){Id =18, InputFieldId =19, Value ="英-中" }
             };
 
             modelBuilder.Entity<AppealType>().HasData(appealTypes);

+ 74 - 4
wispro.sp.web/Components/CreateAppeal.razor

@@ -1,4 +1,4 @@
-@inherits FeedbackComponent<AppealRecord>
+@inherits FeedbackComponent<CreateAppealModel>
 
 
 
@@ -6,17 +6,87 @@
     <div>
         <Row>
             <AntDesign.Col Span="4"><b>我方文号:</b></AntDesign.Col>
-            <AntDesign.Col Span="8">@_Item.CaseNo</AntDesign.Col>
+            <AntDesign.Col Span="8">@_Model.Item.CaseNo</AntDesign.Col>
             <AntDesign.Col Span="4"><b>处理事项:</b></AntDesign.Col>
-            <AntDesign.Col Span="8">@_Item.DoItem</AntDesign.Col>
+            <AntDesign.Col Span="8">@_Model.Item.DoItem</AntDesign.Col>
         </Row>
         <Row><AntDesign.Col Span="24">&nbsp;</AntDesign.Col></Row>
         <Row>
             <AntDesign.Col Span="4"><b>案件名称:</b></AntDesign.Col>
-            <AntDesign.Col Span="20">@_Item.CaseName</AntDesign.Col>
+            <AntDesign.Col Span="20">@_Model.Item.CaseName</AntDesign.Col>
 
         </Row>
     </div>
 </Card>
+<Card>
+    <Form Model="@_Model" LabelColSpan="6" WrapperColSpan="16">
+        <FormItem Label="请谁确认">
+            <Select DataSource="@Reviewers"
+                    @bind-Value="@context.AppealRecord.ReviewerId"
+                    LabelName="@nameof(Staff.Name)"
+                    ValueName="@nameof(Staff.Id)"
+                    Placeholder="请选择确认人"
+                    Style="width: 100%"
+                    AllowClear
+                    DefaultActiveFirstItem="false"
+                    EnableSearch>
+            </Select>
+        </FormItem>
+        @foreach (InputFieldValue field in context.inputFieldValues)
+        {
+    <FormItem Label="@field.InputField.FieldName">
+        @switch (field.InputField.FieldType)
+        {
+            case "System.String":
+                if (field.InputField.SelectValues != null && field.InputField.SelectValues.Count > 0)
+                {
+                    <Select @bind-Value="@field.Value" DataSource="@field.InputField.SelectValues"
+                            ValueName="@nameof(SelectValue.Value)"
+                            LabelName="@nameof(SelectValue.Value)" />
+                }
+                else
+                {
+                    <Input @bind-Value="@field.Value" />
+                }
+
+                break;
+            case "System.DateTime":
+                <DatePicker @bind-Value="@field.Value" />
+                break;
+            
+             default:
+                <Input @bind-Value="@field.Value" />
+                 break;
+
+             }
+
+    </FormItem>
+        }
+
+        <FormItem Label="附件">
+            <Upload @attributes="attrs"
+                    FileList="fileList"
+                    OnChange="HandleChange">
+                <Button Icon="upload"><span>添加附件</span></Button>
+            </Upload>
+        </FormItem>
+    </Form>
+    
+</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>
+
+
+
 
 

+ 80 - 27
wispro.sp.web/Components/CreateAppeal.razor.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text.Json;
 using System.Threading.Tasks;
 using wispro.sp.entity;
+using wispro.sp.web.Models;
 using wispro.sp.web.Services;
 
 namespace wispro.sp.web.Components
@@ -14,51 +15,103 @@ namespace wispro.sp.web.Components
     public partial class CreateAppeal
     {
 
+        private CreateAppealModel _Model;
         
-        public PerformanceItem _Item;
-
-        
-        public int _AppealTypeId;
 
         [Inject]
         protected AppealTypeService _atService { get; set; }
 
-        private List<InputField> inputFields;
-        private List<InputFieldValue> inputFieldValues;
-        private AppealType _CurrentAppealType;
-        private AppealRecord aRecord;
+       
 
-        public async Task SetParameter(PerformanceItem item, int appealTypeId)
+        List<Staff> Reviewers = new List<Staff>()
         {
-            _Item = item;
-            _AppealTypeId = appealTypeId;
+            new Staff(){Id =1,Name ="钟子敏"},
+            new Staff(){Id =2,Name ="邢丽霞"},
+            new Staff(){Id =3,Name ="李丽"},
+            new Staff(){Id =4,Name ="贾凤涛"},
+        };
 
-            _CurrentAppealType =await _atService.GetItem(_AppealTypeId);
+        #region 文件上传控件设定
+        List<UploadFileItem> fileList = new List<UploadFileItem>
+            {
+                new UploadFileItem
+                {
+                    Id = "1",
+                    FileName = "客户往来邮件1.jpg",
+                    Url = "#",
+                    State = UploadState.Success
+                },
+                new UploadFileItem
+                {
+                    Id = "2",
+                    FileName = "与客户微信聊天图片.jpg",
+                    Url = "#",
+                    State = UploadState.Success
+                },
+                new UploadFileItem
+                {
+                    Id = "3",
+                    FileName = "附件.docx",
+                    Url = "#",
+                    State = UploadState.Success
+                }
+            };
 
-            inputFields = await _atService.GetInputFields(_AppealTypeId, 0);
+        Dictionary<string, object> attrs = new Dictionary<string, object>
+        {
+            {"Action", "http://localhost:39476/api/AttachFiles/PostFile" },
+            {"Name", "files" },
+            {"Multiple", false }
+        };
 
-            
+        void HandleChange(UploadInfo fileinfo)
+        {
+            //if (fileList.Count > 5)
+            //{
+            //    fileList.RemoveRange(0, fileList.Count - 2);
+            //}
+            //fileList.Where(file => file.State == UploadState.Success && !string.IsNullOrWhiteSpace(file.Response)).ForEach(file => {
+            //    var result = file.GetResponse<ResponseModel>();
+            //    file.Url = result.url;
+            //});
         }
-        //public override async Task<Task> SetParametersAsync(ParameterView parameters)
-        //{
-        //    int temOut;
-        //    if(parameters.TryGetValue("AppealTypeId",out temOut))
-        //    {
-        //        _CurrentAppealType =await _atService.GetItem(temOut);
-        //    }
 
-        //    return base.SetParametersAsync(parameters);
-        //}
+        public class ResponseModel
+        {
+            public string name { get; set; }
+
+            public string status { get; set; }
+
+            public string url { get; set; }
+
+            public string thumbUrl { get; set; }
+        }
+        #endregion
 
-        private void OnFinish(EditContext editContext)
+
+        protected override async void OnInitialized()
+        {
+            _Model = base.Options ?? new CreateAppealModel();
+            Console.WriteLine($"Success:{JsonSerializer.Serialize(_Model)}");
+            base.OnInitialized();
+        }
+
+
+
+        private void OnFinish()
         {
-            //Console.WriteLine($"Success:{JsonSerializer.Serialize(_model)}");
+            Console.WriteLine($"Success:{JsonSerializer.Serialize(_Model)}");
             _ = base.FeedbackRef.CloseAsync();
         }
 
-        private void OnFinishFailed(EditContext editContext)
+        private void OnCancel()
         {
-            //Console.WriteLine($"Failed:{JsonSerializer.Serialize(_model)}");
+            _ = base.FeedbackRef.CloseAsync();
         }
+
+        //private void OnFinishFailed(EditContext editContext)
+        //{
+        //    Console.WriteLine($"Failed:{JsonSerializer.Serialize(Model)}");
+        //}
     }
 }

+ 61 - 0
wispro.sp.web/Models/CreateAppealModel.cs

@@ -0,0 +1,61 @@
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json;
+using System.Threading.Tasks;
+using wispro.sp.entity;
+using wispro.sp.web.Services;
+
+namespace wispro.sp.web.Models
+{
+    public class CreateAppealModel
+    {
+        public PerformanceItem Item { get; set; }
+
+        public AppealType AppealType { get; set; }
+
+        private List<InputField> inputFields;
+        public List<InputFieldValue> inputFieldValues { get; set; }
+
+        public AppealRecord AppealRecord { get; set; }
+
+        
+        public CreateAppealModel() { }
+
+        
+        
+
+        public async Task Init(AppealTypeService _atService,PerformanceItem item,AppealType appealType)
+        {
+            Item = item;
+            AppealType = appealType;
+            AppealRecord = new AppealRecord();
+            AppealRecord.TypeId = appealType.Id;
+            AppealRecord.ItemId = item.Id;
+            AppealRecord.State = 0;
+
+            if (AppealType != null)
+            {
+                inputFieldValues = new List<InputFieldValue>();
+
+                Console.WriteLine($"CreateAppealModel:{JsonSerializer.Serialize(AppealType)}");
+                if(_atService == null)
+                {
+                    Console.WriteLine($"CreateAppealModel:_atService = null");
+                }
+
+                inputFields =await _atService.GetInputFields(AppealType.Id, 0);
+
+                foreach (var field in inputFields)
+                {
+                    var fValue = new InputFieldValue();
+                    fValue.InputField = field;
+                    fValue.InputFieldId = field.Id;
+                    inputFieldValues.Add(fValue);
+                }
+            }
+            
+        }
+    }
+}

+ 0 - 18
wispro.sp.web/Models/InputField.cs

@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace wispro.sp.web.Models
-{
-    public class InputField
-    {
-        public string FieldName { get; set; }
-
-        public string FieldType { get; set; }
-
-        public string FieldValue { get; set; }
-
-        public string MapObjectField { get; set; }
-    }
-}

+ 1 - 0
wispro.sp.web/Models/ProjectInfo.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using wispro.sp.entity;
 
 namespace wispro.sp.web.Models
 {

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

@@ -121,7 +121,7 @@
                                 <ActionColumn Fixed="right" Title="操作" Width="120">
                                     <Space>
                                         <SpaceItem>
-                                            <AntDesign.DropdownButton OnClick="() => OnsubShensu(context)" Type="@((ButtonType.Primary, ButtonType.Default))" ButtonsStyle="@("background-color: #1890ff;")">
+                                            <AntDesign.Dropdown>
                                                 <Overlay>
                                                     <Menu>
                                                         @foreach(var apType in  apTypeService.GetItems(context))
@@ -131,8 +131,10 @@
                                                        
                                                     </Menu>
                                                 </Overlay>
-                                                <ChildContent>申诉</ChildContent>
-                                            </AntDesign.DropdownButton>
+                                                <ChildContent>
+                                                    <Button Type="Primary">操作</Button>
+                                                </ChildContent>
+                                            </AntDesign.Dropdown>
                                         </SpaceItem>
                                     </Space>
 
@@ -300,71 +302,5 @@
     </Form>
 </Modal>
 
-<Modal Title="申诉窗口" Visible="@_visible"
-       OnOk="@HandleOk"
-       OnCancel="@HandleCancel"
-       MaskClosable="false"
-       Width="600">
-    <Card Style="width:100%" Bordered>
-        <div>
-            <Row>
-                <AntDesign.Col Span="4"><b>我方文号:</b></AntDesign.Col>
-                <AntDesign.Col Span="8">@EditingItem.CaseNo</AntDesign.Col>
-                <AntDesign.Col Span="4"><b>处理事项:</b></AntDesign.Col>
-                <AntDesign.Col Span="8">@EditingItem.DoItem</AntDesign.Col>
-            </Row>
-            <Row><AntDesign.Col Span="24">&nbsp;</AntDesign.Col></Row>
-            <Row>
-                <AntDesign.Col Span="4"><b>案件名称:</b></AntDesign.Col>
-                <AntDesign.Col Span="20">@EditingItem.CaseName</AntDesign.Col>
 
-            </Row>
-        </div>
-    </Card>
-    <br />
-    <Form Model="_shenshou" LabelColSpan="6" WrapperColSpan="16">
-        <FormItem Label="类型">
-            <Select DataSource="@AvatarMenuItems"
-                    @bind-Value="@context.Type"
-                    LabelName="@nameof(shensuType.Name)"
-                    ValueName="@nameof(shensuType.Name)"
-                    Placeholder="请选择申诉类型"
-                    Style="width:100%"
-                    AllowClear
-                    DefaultActiveFirstItem="false"
-                    EnableSearch
-                    OnSelectedItemChanged="OnSelectedItemChangedHandler">
-            </Select>
-        </FormItem>
-        <FormItem Label="向谁申诉">
-            <Select DataSource="@Reviewers"
-                    @bind-Value="@context.ReviewerId"
-                    LabelName="@nameof(Staff.Name)"
-                    ValueName="@nameof(Staff.Id)"
-                    Placeholder="请选择审核人"
-                    Style="width: 100%"
-                    AllowClear
-                    DefaultActiveFirstItem="false"
-                    EnableSearch>
-            </Select>
-        </FormItem>
-        @if (_SelectedItem != null && !string.IsNullOrEmpty(_SelectedItem.ChangeField))
-        {
-            <FormItem Label=@($"{_SelectedItem.ChangeField}变更为")>
-                <Input @bind-Value="@context.ChangeTo" />
-            </FormItem>
-        }
-        <FormItem Label="申诉理由">
-            <TextArea @bind-Value="@context.Reason" Rows="6" Style="width: 100%" />
-        </FormItem>
-        <FormItem Label="附件">
-            <Upload @attributes="attrs"
-                    FileList="fileList"
-                    OnChange="HandleChange">
-                <Button Icon="upload"><span>添加附件</span></Button>
-            </Upload>
-        </FormItem>
-    </Form>
-
-</Modal>
 

+ 61 - 59
wispro.sp.web/Pages/AppCase/MyCaselist.razor.cs

@@ -87,7 +87,14 @@ namespace wispro.sp.web.Pages.AppCase
             var HandlingCalMonth = await _CalMonthService.GetHandlingMonth();
             if (HandlingCalMonth != null)
             {
-                MyStatistics = await _ItemService.CalMyStatistics(HandlingCalMonth.Year, HandlingCalMonth.Month, _userService.CurrentUser.Userid.Value);
+                if (_userService.CurrentUser.Userid != null)
+                {
+                    MyStatistics = await _ItemService.CalMyStatistics(HandlingCalMonth.Year, HandlingCalMonth.Month, _userService.CurrentUser.Userid.Value);
+                }
+                else
+                {
+                    NavigationManager.NavigateTo("/LoginPages");
+                }
             }
             
         }
@@ -235,63 +242,7 @@ namespace wispro.sp.web.Pages.AppCase
             _SelectedItem = value;
             //StaffGradeIdChanged.InvokeAsync(_SelectedItem.Id);
         }
-        #region 文件上传控件设定
-        List<UploadFileItem> fileList = new List<UploadFileItem>
-            {
-                new UploadFileItem
-                {
-                    Id = "1",
-                    FileName = "客户往来邮件1.jpg",
-                    Url = "#",
-                    State = UploadState.Success
-                },
-                new UploadFileItem
-                {
-                    Id = "2",
-                    FileName = "与客户微信聊天图片.jpg",
-                    Url = "#",
-                    State = UploadState.Success
-                },
-                new UploadFileItem
-                {
-                    Id = "3",
-                    FileName = "附件.docx",
-                    Url = "#",
-                    State = UploadState.Success
-                }
-            };
-
-        Dictionary<string, object> attrs = new Dictionary<string, object>
-        {
-            {"Action", "#" },
-            {"Name", "files" },
-            {"Multiple", true }
-        };
-
-        void HandleChange(UploadInfo fileinfo)
-        {
-            //if (fileList.Count > 5)
-            //{
-            //    fileList.RemoveRange(0, fileList.Count - 2);
-            //}
-            //fileList.Where(file => file.State == UploadState.Success && !string.IsNullOrWhiteSpace(file.Response)).ForEach(file => {
-            //    var result = file.GetResponse<ResponseModel>();
-            //    file.Url = result.url;
-            //});
-        }
-
-        public class ResponseModel
-        {
-            public string name { get; set; }
-
-            public string status { get; set; }
-
-            public string url { get; set; }
-
-            public string thumbUrl { get; set; }
-        }
-        #endregion
-
+        
         
 
 
@@ -357,8 +308,59 @@ namespace wispro.sp.web.Pages.AppCase
             StateHasChanged();
         }
 
-        void ShowModel(PerformanceItem Item,AppealType appealType)
+        private ModalRef _modalRef;
+        [Inject] ModalService _ModalService { get; set; }
+        [Inject]protected AppealTypeService _atService { get; set; }
+        async Task ShowModel(PerformanceItem Item,AppealType appealType)
         {
+            var templateOptions = new Models.CreateAppealModel();
+            Console.WriteLine($"Success:{JsonSerializer.Serialize(appealType)}");
+            await templateOptions.Init(_atService,Item, appealType);
+            
+            var modalConfig = new ModalOptions();
+            modalConfig.Title = appealType.Name;
+            modalConfig.Footer = null;
+            modalConfig.OnCancel = async (e) =>
+            {
+                Console.WriteLine("OnCancel");
+                await _modalRef.CloseAsync();
+            };
+
+            modalConfig.AfterClose = () =>
+            {
+                Console.WriteLine("AfterClose");
+                
+                InvokeAsync(StateHasChanged);
+                return Task.CompletedTask;
+            };
+
+            _modalRef = await _ModalService
+                .CreateModalAsync<Components.CreateAppeal , Models.CreateAppealModel>
+                (modalConfig, templateOptions);
+
+            _modalRef.OnOpen = () =>
+            {
+                Console.WriteLine("ModalRef OnOpen");
+                return Task.CompletedTask;
+            };
+
+            _modalRef.OnOk = () =>
+            {
+                Console.WriteLine("ModalRef OnOk");
+                return Task.CompletedTask;
+            };
+
+            _modalRef.OnCancel = () =>
+            {
+                Console.WriteLine("ModalRef OnCancel");
+                return Task.CompletedTask;
+            };
+
+            _modalRef.OnClose = () =>
+            {
+                Console.WriteLine("ModalRef OnClose");
+                return Task.CompletedTask;
+            };
             StateHasChanged();
         }
     }

+ 1 - 1
wispro.sp.web/Pages/AppCase/ShensuReview.razor.cs

@@ -49,7 +49,7 @@ namespace wispro.sp.web.Pages.AppCase
         protected override void OnParametersSet()
         {
             base.OnParametersSet();
-            _task = taskService.GetTask(Id);
+            //_task = taskService.GetTask(Id);
         }
 
     }

+ 1 - 0
wispro.sp.web/Services/AppealTypeService.cs

@@ -47,6 +47,7 @@ namespace wispro.sp.web.Services
                 if (!string.IsNullOrWhiteSpace(at.CanDoExpress))
                 {
                     var interpreter = new Interpreter();
+                    Console.WriteLine(at.CanDoExpress);
                     Func<PerformanceItem, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem, bool>>(at.CanDoExpress, "p");
                     bool result = func.Invoke(item);
 

+ 3 - 157
wispro.sp.web/Services/TaskService.cs

@@ -8,163 +8,9 @@ namespace wispro.sp.web.Services
 {
     public class TaskService
     {
-        private static ProjectInfo project = new ProjectInfo()
-        {
-            CaseNo = "WOCN2111703",
-            CaseName = "NETWORK SWITCHING METHOD, APPARATUS, USER EQUIPTMENT, AND STORAGE MEDIUM",
-            DoItem = "新申请",
-            DoPerson = new List<string>() { "李申" },
-            ResponseMan = ""
-        };
+        
 
-        private List<Models.Task> Tasks = new List<Models.Task>()
-        {
-            new Models.Task()
-                    {
-                        Id =1,
-                        ProjectInfo = project,
-                        Name =$"案件{project.CaseNo}申诉审核",
-                        Creater = "李申",
-                        ResponseMan ="李丽",
-                        LimiteDate = new DateTime(2021,10,20),
-                        Type ="申诉审核", CreateTime = DateTime.Now, State="待处理",
-                        InputFields = new List<InputField>()
-                        {
-                            new(){ FieldName ="申诉类型", FieldType="string", FieldValue="案件系数申诉"},
-                            new(){ FieldName ="案件系数变更为", FieldType="string", FieldValue="A"}
-                        }
-
-                    },
-            new Models.Task()
-                    {
-                        Id = 1,
-                        ProjectInfo = project,
-                        Name = $"案件{project.CaseNo}申诉审核",
-                        Creater = "李申",
-                        ResponseMan = "李丽",
-                        LimiteDate = new DateTime(2021, 10, 20),
-                        Type = "申诉审核",
-                        CreateTime = DateTime.Now,
-                        State = "待处理",
-                        InputFields = new List<InputField>()
-                        {
-                            new(){ FieldName ="申诉类型", FieldType="string", FieldValue="案件系数申诉"},
-                            new(){ FieldName ="处理事项系数变更为", FieldType="string", FieldValue="A"}
-                        }
-
-                    }, new Models.Task()
-                    {
-                        Id = 1,
-                        ProjectInfo = project,
-                        Name = $"案件{project.CaseNo}申诉审核",
-                        Creater = "李申",
-                        ResponseMan = "李丽",
-                        LimiteDate = new DateTime(2021, 10, 20),
-                        Type = "申诉审核",
-                        CreateTime = DateTime.Now,
-                        State = "待处理",
-                        InputFields = new List<InputField>()
-                        {
-                            new(){ FieldName ="申诉类型", FieldType="string", FieldValue="案件系数申诉"},
-                            new(){ FieldName ="处理人变更为", FieldType="string", FieldValue="何倚雯"}
-                        }
-
-                    }, new Models.Task()
-                    {
-                        Id = 1,
-                        ProjectInfo = project,
-                        Name = $"案件{project.CaseNo}申诉审核",
-                        Creater = "李申",
-                        ResponseMan = "李丽",
-                        LimiteDate = new DateTime(2021, 10, 20),
-                        Type = "申诉审核",
-                        CreateTime = DateTime.Now,
-                        State = "待处理",
-                        InputFields = new List<InputField>()
-                        {
-                            new(){ FieldName ="申诉类型", FieldType="string", FieldValue="案件系数申诉"},
-                            new(){ FieldName ="核稿人变更为", FieldType="string", FieldValue="钟子敏"}
-                        }
-
-                    }, new Models.Task()
-                    {
-                        Id = 1,
-                        ProjectInfo = project,
-                        Name = $"案件{project.CaseNo}申诉审核",
-                        Creater = "李申",
-                        ResponseMan = "李丽",
-                        LimiteDate = new DateTime(2021, 10, 20),
-                        Type = "申诉审核",
-                        CreateTime = DateTime.Now,
-                        State = "待处理",
-                        InputFields = new List<InputField>()
-                        {
-                            new(){ FieldName ="超期原因", FieldType="string", FieldValue="客户看稿超过一个月才回复!"}
-                        }
-
-                    }, new Models.Task()
-                    {
-                        Id = 1,
-                        ProjectInfo = project,
-                        Name = $"案件{project.CaseNo}申诉审核",
-                        Creater = "李申",
-                        ResponseMan = "李丽",
-                        LimiteDate = new DateTime(2021, 10, 20),
-                        Type = "申诉审核",
-                        CreateTime = DateTime.Now,
-                        State = "待处理",
-                        InputFields = new List<InputField>()
-                        {
-                            new(){ FieldName ="分配比率", FieldType="string", FieldValue="按照李申(2),何倚雯(1)的比例分配!"}
-                        }
-
-                    }, new Models.Task()
-                    {
-                        Id = 1,
-                        ProjectInfo = project,
-                        Name = $"案件{project.CaseNo}申诉审核",
-                        Creater = "李申",
-                        ResponseMan = "李丽",
-                        LimiteDate = new DateTime(2021, 10, 20),
-                        Type = "申诉审核",
-                        CreateTime = DateTime.Now,
-                        State = "待处理",
-                        InputFields = new List<InputField>()
-                        {
-                            new(){ FieldName ="申诉类型", FieldType="string", FieldValue="缺失案件提报"},
-                            new(){ FieldName ="我方文号", FieldType="string", FieldValue="PACN1810394"}                            ,
-                            new(){ FieldName ="处理事项", FieldType="string", FieldValue="处理审查意见"}
-                        }
-
-                    },new Models.Task()
-                    {
-                        Id = 1,
-                        ProjectInfo = project,
-                        Name = $"案件{project.CaseNo}申诉审核",
-                        Creater = "李申",
-                        ResponseMan = "李丽",
-                        LimiteDate = new DateTime(2021, 10, 20),
-                        Type = "申诉审核",
-                        CreateTime = DateTime.Now,
-                        State = "待处理",
-                        InputFields = new List<InputField>()
-                        {
-                            new(){ FieldName ="申诉类型", FieldType="string", FieldValue="涉外案件点数算法备注"},
-                            new(){ FieldName ="算法备注", FieldType="string", FieldValue="按字数计算"}                            ,
-                            new(){ FieldName ="字数", FieldType="string", FieldValue="18000"}
-                        }
-
-                    }
-        };
-
-        public Models.Task GetTask(int id)
-        {
-            if(id <= Tasks.Count)
-            {
-                return Tasks[id - 1];
-            }
-
-            return null;
-        }
+        
+        
     }
 }

+ 20 - 0
wispro.sp.web/wispro.sp.web.csproj

@@ -8,6 +8,22 @@
 
   <ItemGroup>
     <Compile Remove="AuthProvider.cs" />
+    <Compile Remove="Models\ProjectInfo.cs" />
+    <Compile Remove="Pages\AppCase\ShensuReview.razor.cs" />
+    <Compile Remove="Pages\Project\AssignPoint.razor.cs" />
+    <Compile Remove="Pages\Project\ConfirmProjectPoint.razor.cs" />
+    <Compile Remove="Pages\Project\ProjectList.razor.cs" />
+    <Compile Remove="Pages\Project\ReadAssignPointMsg.razor.cs" />
+    <Compile Remove="Pages\Project\ReadMessage.razor.cs" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Content Remove="Pages\AppCase\ShensuReview.razor" />
+    <Content Remove="Pages\Project\AssignPoint.razor" />
+    <Content Remove="Pages\Project\ConfirmProjectPoint.razor" />
+    <Content Remove="Pages\Project\ProjectList.razor" />
+    <Content Remove="Pages\Project\ReadAssignPointMsg.razor" />
+    <Content Remove="Pages\Project\ReadMessage.razor" />
   </ItemGroup>
 
   <ItemGroup>
@@ -67,4 +83,8 @@
     </Content>
   </ItemGroup>
 
+  <ItemGroup>
+    <Folder Include="Pages\Project\" />
+  </ItemGroup>
+
 </Project>

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

@@ -177,7 +177,7 @@ namespace wispro.sp.winClient
 
             await InitRules(true);
 
-            return;
+            //return;
 
             await ImportUsers();
             await InputPerformanceItem("ExcelFiles\\21.01-21.06 工程师绩效报表-总表.xlsx", true, false, 0);

+ 5 - 1
wospro.sp.entity/AppealRecord.cs

@@ -27,7 +27,7 @@ namespace wispro.sp.entity
         /// </summary>
         public int State { get; set; }
 
-        public Staff Reviewer { get; set; }
+        public virtual Staff Reviewer { get; set; }
 
         public int ReviewerId { get; set; }
 
@@ -38,5 +38,9 @@ namespace wispro.sp.entity
         public virtual AppealType Type { get; set; }
 
         public int TypeId { get; set; }
+
+        public int ItemId { get; set; }
+
+        public virtual PerformanceItem Item { get; set; }
     }
 }

+ 1 - 1
wospro.sp.entity/AttachFile.cs

@@ -20,6 +20,6 @@ namespace wispro.sp.entity
 
         public AppealRecord AppealRecord { get; set; }
 
-        public int AppealRecordId { get; set; }
+        public int? AppealRecordId { get; set; }
     }
 }