AgentFeedbackMemoItemsServices.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using DynamicExpresso;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using wispro.sp.entity;
  7. namespace wispro.sp.web.Services
  8. {
  9. public class Reason
  10. {
  11. public string Value { get; set; }
  12. public string Name { get; set; }
  13. public List<string> Expresses {get;set;}
  14. }
  15. public interface IAgentFeedBackMemoItemsService
  16. {
  17. List<Reason> GetItems(PerformanceItem item);
  18. }
  19. public class AgentFeedbackMemoItemsServices:IAgentFeedBackMemoItemsService
  20. {
  21. List<Reason> _Reasons = new List<Reason>()
  22. {
  23. new Reason(){Name="PCT首次英文案",Value="PCT首次英文案", Expresses= new List<string>(){ "p.DoItem==\"新申请\"" } },
  24. new Reason(){Name="我方转格式、复核",Value="我方转格式、复核" ,Expresses= new List<string>()},
  25. new Reason(){Name="台湾案转大陆案",Value="台湾案转大陆案",Expresses= new List<string>(){ "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PACN\") " } },
  26. new Reason(){Name="大陆案转台湾案",Value="大陆案转台湾案",Expresses= new List<string>(){ "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PATW\") " } },
  27. new Reason(){Name="同套大陆+台湾",Value="同套大陆+台湾",Expresses= new List<string>(){
  28. "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PATW\")",
  29. "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\")",
  30. "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\")",
  31. "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PATW\")"} },
  32. new Reason(){Name="不请款",Value="不请款",Expresses= new List<string>(){
  33. "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"实用新型\"",
  34. "p.DoItem==\"意见陈述\" && p.ApplicationType==\"实用新型\"" } },
  35. new Reason(){Name="撤回后重新递交",Value="撤回后重新递交",Expresses= new List<string>()},
  36. new Reason(){Name="发文后客户取消申请",Value="发文后客户取消申请",Expresses= new List<string>(){
  37. "p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\")",
  38. "p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\")"} },
  39. new Reason(){Name="发文后客户原因取消申请,系统结案",Value="发文后客户原因取消申请,系统结案",Expresses= new List<string>(){
  40. "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PADE\")",
  41. "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PAUS\")",
  42. "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PAIN\")",
  43. "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PAGB\")",
  44. "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PAEPO\")",
  45. } },
  46. new Reason(){Name="改权",Value="改权",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" } },
  47. new Reason(){Name="改权+改说明书",Value="改权+改说明书",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" }},
  48. new Reason(){Name="客户不进行答辩",Value="客户不进行答辩",Expresses= new List<string>(){ "p.DoItem==\"处理审查意见\"" } },
  49. new Reason(){Name="客户提供答辩点,撰写英文报导函",Value="客户提供答辩点,撰写英文报导函",Expresses= new List<string>(){
  50. "p.DoItem==\"处理审查意见\" && !p.CaseNo.Contains(\"CN\")" } },
  51. new Reason(){Name="客户未提供答辩点,撰写英文报导函",Value="客户未提供答辩点,撰写英文报导函辩",Expresses= new List<string>(){ "p.DoItem==\"处理审查意见\" && !p.CaseNo.Contains(\"CN\")" }},
  52. new Reason(){Name="内-外",Value="内-外",Expresses= new List<string>(){ "p.DoItem==\"翻译校核\"" } },
  53. new Reason(){Name="外-内",Value="外-内",Expresses= new List<string>(){ "p.DoItem==\"翻译校核\"" }},
  54. new Reason(){Name="外-内首次申请",Value="外-内首次申请",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" } },
  55. new Reason(){Name="请款",Value="请款",Expresses= new List<string>(){
  56. "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"实用新型\" && p.CaseStage==\"二通\"",
  57. "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"实用新型\" && p.CaseStage==\"一通\"",
  58. "p.DoItem==\"请求复审\" && p.ApplicationType==\"实用新型\"",
  59. "p.DoItem==\"意见陈述\" && p.ApplicationType==\"实用新型\"",
  60. } },
  61. new Reason(){Name="涉外OA不答辩,发报导函结案",Value="涉外OA不答辩,发报导函结案",Expresses= new List<string>(){ "p.DoItem==\"处理审查意见\"" } },
  62. new Reason(){Name="涉外实质改权",Value="涉外实质改权",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" } },
  63. new Reason(){Name="首次中文案",Value="首次中文案",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" } },
  64. new Reason(){Name="我方转格式、复核",Value="我方转格式、复核",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" } },
  65. new Reason(){Name="外所/他人首次转入OA",Value="外所/他人首次转入OA",Expresses= new List<string>(){ "p.DoItem==\"处理审查意见\"" } },
  66. new Reason(){Name="我方代交",Value="我方代交",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" } },
  67. new Reason(){Name="转格式",Value="转格式",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" } },
  68. new Reason(){Name="撰写中客户取消申请",Value="撰写中客户取消申请",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" }},
  69. new Reason(){Name="中-英",Value="中-英",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" , "p.DoItem==\"翻译\"" } },
  70. new Reason(){Name="英-中",Value="英-中",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" , "p.DoItem==\"翻译\"" }},
  71. new Reason(){Name="英-德",Value="英-德",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" , "p.DoItem==\"翻译\"" }},
  72. new Reason(){Name="已算绩效",Value="已算绩效",Expresses= new List<string>(){ "p.DoItem==\"新申请\"" , "p.DoItem==\"翻译\"", "p.DoItem==\"处理审查意见\"" }}
  73. };
  74. public List<Reason> GetItems(PerformanceItem item)
  75. {
  76. List<Reason> retList = new List<Reason>();
  77. foreach(var r in _Reasons)
  78. {
  79. if(r.Expresses == null || r.Expresses.Count == 0)
  80. {
  81. retList.Add(r);
  82. }
  83. else
  84. {
  85. foreach(string strExpress in r.Expresses)
  86. {
  87. var interpreter = new Interpreter();
  88. //item.ApplicationType
  89. Func<PerformanceItem, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem, bool>>(strExpress, "p");
  90. bool result = func.Invoke(item);
  91. if (result)
  92. {
  93. retList.Add(r);
  94. break;
  95. }
  96. }
  97. }
  98. }
  99. return retList;
  100. }
  101. }
  102. }