spDbContext.cs 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. using Microsoft.EntityFrameworkCore;
  2. using Microsoft.Extensions.Configuration;
  3. using System.Collections.Generic;
  4. using System.Configuration;
  5. using wispro.sp.entity;
  6. namespace wispro.sp.api
  7. {
  8. public partial class spDbContext : DbContext
  9. {
  10. public spDbContext()
  11. {
  12. }
  13. public spDbContext(DbContextOptions<spDbContext> options)
  14. : base(options)
  15. {
  16. }
  17. public virtual DbSet<CalMonth> CalMonths { get; set; }
  18. public virtual DbSet<Customer> Customers { get; set; }
  19. public virtual DbSet<ItemStaff> ItemStaffs { get; set; }
  20. public virtual DbSet<PerformanceItem> PerformanceItems { get; set; }
  21. public virtual DbSet<StaffGrade> StaffGrades { get; set; }
  22. public virtual DbSet<VerifyCoefficient> VerifyCoefficients { get; set; }
  23. public virtual DbSet<Staff> Staffs { get; set; }
  24. public virtual DbSet<Message> Messages { get; set; }
  25. public virtual DbSet<MessageReadRecord> MessageReadRecords { get;set;}
  26. public virtual DbSet<MessagePerformanceItem> MessagePerformanceItems { get; set; }
  27. public virtual DbSet<AttachFile> AttachFiles { get; set; }
  28. public virtual DbSet<BasePointRule> BasePointRules { get; set; }
  29. public virtual DbSet<InputField> InputFields { get; set; }
  30. public virtual DbSet<InputFieldValue> InputFieldValues { get; set; }
  31. public virtual DbSet<AppealType> AppealTypes { get; set; }
  32. public virtual DbSet<AppealRecord> AppealRecords { get; set; }
  33. public virtual DbSet<SelectValue> SelectValues { get; set; }
  34. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  35. {
  36. if (!optionsBuilder.IsConfigured)
  37. {
  38. optionsBuilder.UseSqlServer(utility.ConfigHelper.GetSectionValue("ConnectionStrings:DefaultConnect"));// "Data Source=(local);Initial Catalog=spDB;User ID=sa;Password=Lqftiu807005");// Configuration.GetConnectionString("DefaultConnect"));
  39. //ConfigurationManager.AppSettings["ValidAudience"]
  40. }
  41. }
  42. protected override void OnModelCreating(ModelBuilder modelBuilder)
  43. {
  44. modelBuilder.Entity<BasePointRule>(entity=> {
  45. entity.ToTable("BasePointRule");
  46. entity.Property(e => e.PointExpress).HasMaxLength(100);
  47. entity.Property(e => e.Rule).HasMaxLength(1000);
  48. entity.Property(e => e.Type).HasMaxLength(20);
  49. });
  50. modelBuilder.Entity<CalMonth>(entity =>
  51. {
  52. entity.ToTable("CalMonth");
  53. entity.Property(e => e.Year).HasColumnName("year");
  54. entity.Property(e => e.Month).HasColumnName("month");
  55. entity.Property(e => e.Status).HasColumnName("status");
  56. }
  57. ) ;
  58. modelBuilder.Entity<Customer>(entity =>
  59. {
  60. entity.ToTable("Customer");
  61. entity.Property(e => e.Address).HasMaxLength(500);
  62. entity.Property(e => e.ContactMan).HasMaxLength(50);
  63. entity.Property(e => e.Name)
  64. .IsRequired()
  65. .HasMaxLength(200);
  66. entity.Property(e => e.Phone).HasMaxLength(50);
  67. entity.HasOne(d => d.ResponseMan)
  68. .WithMany(p => p.Customers)
  69. .HasForeignKey(d => d.ResponseManId)
  70. .HasConstraintName("FK_Customer_Staff");
  71. });
  72. modelBuilder.Entity<ItemStaff>(entity =>
  73. {
  74. entity.HasKey(e => new { e.ItemId, e.DoPersonId });
  75. entity.ToTable("ItemStaff");
  76. entity.Property(e => e.PerformancePoint);//.HasColumnType("numeric(18, 2)");
  77. entity.HasOne(d => d.DoPerson)
  78. .WithMany(p => p.ItemStaffs)
  79. .HasForeignKey(d => d.DoPersonId)
  80. .OnDelete(DeleteBehavior.ClientSetNull)
  81. .HasConstraintName("FK_ItemStaff_Staff");
  82. entity.HasOne(d => d.Item)
  83. .WithMany(p => p.ItemStaffs)
  84. .HasForeignKey(d => d.ItemId)
  85. .OnDelete(DeleteBehavior.ClientSetNull)
  86. .HasConstraintName("FK_ItemStaff_PerformanceItem");
  87. });
  88. modelBuilder.Entity<PerformanceItem>(entity =>
  89. {
  90. entity.ToTable("PerformanceItem");
  91. entity.Property(e => e.ApplicationName).HasMaxLength(200);
  92. entity.Property(e => e.ApplicationType).HasMaxLength(50);
  93. entity.Property(e => e.BasePoint).HasColumnType("numeric(18, 2)");
  94. entity.Property(e => e.BusinessType).HasMaxLength(50);
  95. entity.Property(e => e.CaseCoefficient).HasMaxLength(10);
  96. entity.Property(e => e.CaseName).HasMaxLength(500);
  97. entity.Property(e => e.CaseNo).HasMaxLength(50);
  98. entity.Property(e => e.CaseStage).HasMaxLength(50);
  99. entity.Property(e => e.CaseState).HasMaxLength(50);
  100. entity.Property(e => e.CaseType).HasMaxLength(50);
  101. entity.Property(e => e.EntrustingDate).HasColumnType("date");
  102. entity.Property(e => e.CustomerLimitDate).HasColumnType("date");
  103. entity.Property(e => e.DoItem).HasMaxLength(50);
  104. entity.Property(e => e.DoItemCoefficient).HasMaxLength(50);
  105. entity.Property(e => e.DoItemMemo).HasMaxLength(500);
  106. entity.Property(e => e.DoItemState).HasMaxLength(50);
  107. entity.Property(e => e.FinalizationDate).HasColumnType("date");
  108. entity.Property(e => e.FinishedDate).HasColumnType("date");
  109. entity.Property(e => e.FirstDraftDate).HasColumnType("date");
  110. entity.Property(e => e.InternalDate).HasColumnType("date");
  111. entity.Property(e => e.OverDueMemo).HasMaxLength(100);
  112. entity.Property(e => e.PreOastaffId).HasColumnName("PreOAStaffId");
  113. entity.Property(e => e.ReturnDate).HasColumnType("date");
  114. entity.HasOne(d => d.Customer)
  115. .WithMany(p => p.PerformanceItems)
  116. .HasForeignKey(d => d.CustomerId)
  117. .HasConstraintName("FK_PerformanceItem_Customer");
  118. entity.HasOne(d => d.PreOastaff)
  119. .WithMany()
  120. .HasForeignKey(d => d.PreOastaffId)
  121. .HasConstraintName("FK_PerformanceItem_Staff");
  122. entity.HasOne(d => d.Reviewer)
  123. .WithMany(p => p.ReviewerItems)
  124. .HasForeignKey(d => d.ReviewerId)
  125. .HasConstraintName("FK_PerformanceItem_Reviewer");
  126. entity.HasOne(d => d.CalMonth)
  127. .WithMany(p => p.PerformanceItems)
  128. .HasForeignKey(d => d.CalMonthId)
  129. .HasConstraintName("FK_PerformanceItem_CalMonth");
  130. });
  131. modelBuilder.Entity<StaffGrade>(entity =>
  132. {
  133. entity.ToTable("StaffGrade");
  134. entity.Property(e => e.Coefficient);//.HasColumnType("numeric(18, 2)");
  135. entity.Property(e => e.Grade)
  136. .IsRequired()
  137. .HasMaxLength(5)
  138. .IsFixedLength(true);
  139. });
  140. modelBuilder.Entity<VerifyCoefficient>(entity =>
  141. {
  142. entity.HasKey(e => new { e.CheckerId, e.DoPersonId });
  143. entity.ToTable("VerifyCoefficient");
  144. entity.Property(e => e.Coefficient);//.HasColumnType("numeric(18, 2)");
  145. entity.HasOne(d => d.Checker)
  146. .WithMany(p => p.VerifyCoefficientCheckers)
  147. .HasForeignKey(d => d.CheckerId)
  148. .OnDelete(DeleteBehavior.ClientSetNull)
  149. .HasConstraintName("FK_VerifyCoefficient_StaffGrade");
  150. entity.HasOne(d => d.DoPerson)
  151. .WithMany(p => p.VerifyCoefficientDoPeople)
  152. .HasForeignKey(d => d.DoPersonId)
  153. .OnDelete(DeleteBehavior.ClientSetNull)
  154. .HasConstraintName("FK_VerifyCoefficient_StaffGrade1");
  155. });
  156. modelBuilder.Entity<Staff>(entity =>
  157. {
  158. entity.ToTable("Staff");
  159. //entity.Property(e => e.Id).ValueGeneratedNever();
  160. entity.Property(e => e.Account)
  161. .IsRequired()
  162. .HasMaxLength(50);
  163. entity.Property(e => e.Department).HasMaxLength(50);
  164. entity.Property(e => e.EntyDate).HasColumnType("date");
  165. entity.Property(e => e.IsCalPerformsnce).HasColumnName("isCalPerformsnce");
  166. entity.Property(e => e.Name)
  167. .IsRequired()
  168. .HasMaxLength(50);
  169. entity.Property(e => e.Password).IsRequired();
  170. entity.Property(e => e.Status)
  171. .IsRequired()
  172. .HasMaxLength(25);
  173. entity.Property(e => e.WorkPlace).HasMaxLength(50);
  174. entity.HasOne(d => d.StaffGrade)
  175. .WithMany(p => p.Staff)
  176. .HasForeignKey(d => d.StaffGradeId)
  177. .OnDelete(DeleteBehavior.ClientSetNull)
  178. .HasConstraintName("FK_Staff_StaffGrade");
  179. });
  180. modelBuilder.Entity<Message>(entity =>
  181. {
  182. //entity.HasKey(e => e.Id);
  183. entity.ToTable("Message");
  184. entity.Property(e => e.Type);
  185. entity.Property(e => e.MessageInfo).HasMaxLength(500);
  186. entity.HasOne(d => d.From)
  187. .WithMany()
  188. .HasForeignKey(d => d.FromId)
  189. .OnDelete(DeleteBehavior.ClientSetNull)
  190. .HasConstraintName("FK_From_Staff");
  191. });
  192. modelBuilder.Entity<MessageReadRecord>(entity =>
  193. {
  194. entity.HasKey(e => new { e.MessageId,e.StaffId});
  195. entity.ToTable("MessageReadRecord");
  196. entity.Property(e => e.isReaded);
  197. entity.HasOne(d => d.Staff)
  198. .WithMany()
  199. .HasForeignKey(d => d.StaffId)
  200. .OnDelete(DeleteBehavior.ClientSetNull)
  201. .HasConstraintName("FK_MessageReadRecord_Staff");
  202. entity.HasOne(d => d.Message)
  203. .WithMany()
  204. .HasForeignKey(d => d.MessageId)
  205. .OnDelete(DeleteBehavior.ClientSetNull)
  206. .HasConstraintName("FK_MessageReadRecord_Message");
  207. });
  208. modelBuilder.Entity<MessagePerformanceItem>( entity =>
  209. {
  210. entity.HasKey(e=> new { e.ItemId,e.MessageId});
  211. entity.HasOne(d => d.Message)
  212. .WithMany(m => m.RelatedItem)
  213. .HasForeignKey(d => d.MessageId)
  214. .HasConstraintName("FK_MessagePerformanceItem_Message");
  215. entity.HasOne(d => d.Item )
  216. .WithMany()
  217. .HasForeignKey(d => d.ItemId)
  218. .HasConstraintName("FK_MessagePerformanceItem_Item");
  219. });
  220. modelBuilder.Entity<AttachFile>(entity =>
  221. {
  222. entity.ToTable("AttachFile");
  223. entity.Property(e=>e.Name).HasMaxLength(200);
  224. entity.Property(e => e.SavePath).HasMaxLength(200);
  225. entity.HasOne(d => d.UploadUser)
  226. .WithMany()
  227. .HasForeignKey(d => d.UploadUserId)
  228. .HasConstraintName("FK_AttachFile_UpdateUser")
  229. .OnDelete(DeleteBehavior.NoAction);
  230. entity.HasOne(d => d.AppealRecord)
  231. .WithMany()
  232. .HasForeignKey(d => d.AppealRecordId)
  233. .HasConstraintName("FK_AttachFile_AppealRecord");
  234. });
  235. modelBuilder.Entity<AppealType>(entity =>
  236. {
  237. entity.ToTable("AppealType");
  238. entity.Property(e => e.Name).HasMaxLength(50);
  239. entity.Property(e => e.ReviewerExpress).HasMaxLength(500);
  240. entity.Property(e => e.CanDoExpress).HasMaxLength(500);
  241. });
  242. modelBuilder.Entity<AppealRecord>(entity =>
  243. {
  244. entity.ToTable("AppealRecord");
  245. entity.Property(e => e.Reason).HasMaxLength(500);
  246. entity.HasOne(d => d.Creater)
  247. .WithMany()
  248. .HasForeignKey(d => d.CreaterId);
  249. entity.HasOne(d => d.Reviewer)
  250. .WithMany().OnDelete(DeleteBehavior.NoAction)
  251. .HasForeignKey(d => d.ReviewerId);
  252. entity.HasOne(d => d.Type)
  253. .WithMany()
  254. .OnDelete(DeleteBehavior.NoAction)
  255. .HasForeignKey(d => d.TypeId);
  256. }) ;
  257. modelBuilder.Entity<InputField>(entity=> {
  258. entity.ToTable("InputField");
  259. entity.Property(e=>e.FieldName).HasMaxLength(50);
  260. entity.Property(e => e.FieldType).HasMaxLength(50);
  261. entity.Property(e => e.MapObjectField).HasMaxLength(50);
  262. entity.HasOne(d => d.AppealType)
  263. .WithMany()
  264. .HasForeignKey(d=>d.AppealTypeId);
  265. //entity.HasKey(d=>new { d.AppealTypeId,d.AppealState});
  266. });
  267. modelBuilder.Entity<SelectValue>(entity => {
  268. entity.ToTable("SelectValue");
  269. entity.HasOne(d => d.InputField)
  270. .WithMany(s=>s.SelectValues)
  271. .HasForeignKey(d => d.InputFieldId);
  272. //entity.HasKey(d=>new { d.AppealTypeId,d.AppealState});
  273. });
  274. modelBuilder.Entity<InputFieldValue>(entity => {
  275. entity.ToTable("InputFieldValue");
  276. entity.Property(e => e.Value).HasMaxLength(500);
  277. entity.HasOne(d => d.InputField)
  278. .WithMany()
  279. .HasForeignKey(d => d.InputFieldId);
  280. entity.HasOne(d => d.AppealRecord)
  281. .WithMany()
  282. .HasForeignKey(d => d.AppealRecordId);
  283. //entity.HasKey(d=>new { d.AppealRecordId,d.InputFieldId});
  284. });
  285. modelBuilder.Entity<StaffGrade>().HasData(
  286. new StaffGrade[]
  287. {
  288. new StaffGrade() {Id=1, Grade = "S级", Coefficient = 1.2},
  289. new StaffGrade() {Id=2, Grade = "A3级", Coefficient = 1.1},
  290. new StaffGrade() {Id =3, Grade = "A2级", Coefficient = 1.1},
  291. new StaffGrade() {Id=4, Grade = "A1级", Coefficient = 1.1},
  292. new StaffGrade() {Id=5, Grade = "B3级", Coefficient = 1.0},
  293. new StaffGrade() {Id=6, Grade = "B2级", Coefficient = 1.0},
  294. new StaffGrade() {Id=7, Grade = "B1级", Coefficient = 0.9},
  295. new StaffGrade() {Id=8, Grade = "C3级", Coefficient = 0.9},
  296. new StaffGrade() {Id=9, Grade = "C2级", Coefficient = 0.7},
  297. new StaffGrade() {Id= 10, Grade = "C1级", Coefficient = 0.7},
  298. new StaffGrade() {Id=11, Grade = "D3级", Coefficient = 0.6},
  299. new StaffGrade() {Id=12, Grade = "D2级", Coefficient = 0.6},
  300. new StaffGrade() {Id=13, Grade = "D1级", Coefficient = 0.5},
  301. new StaffGrade() {Id=14, Grade = "A级", Coefficient = 1.1},
  302. new StaffGrade() {Id=15, Grade = "C级", Coefficient = 1.0},
  303. new StaffGrade() {Id=16, Grade = "D级", Coefficient = 0.9}
  304. });
  305. modelBuilder.Entity<VerifyCoefficient>().HasData(
  306. new VerifyCoefficient[]
  307. {
  308. new VerifyCoefficient() { CheckerId = 1, DoPersonId =5, Coefficient =0.3},
  309. new VerifyCoefficient() { CheckerId = 1, DoPersonId =6, Coefficient =0.3},
  310. new VerifyCoefficient() { CheckerId = 1, DoPersonId =7, Coefficient =0.3},
  311. new VerifyCoefficient() { CheckerId = 1, DoPersonId =8, Coefficient =0.3},
  312. new VerifyCoefficient() { CheckerId = 1, DoPersonId =9, Coefficient =0.4},
  313. new VerifyCoefficient() { CheckerId = 1, DoPersonId =10, Coefficient =0.4},
  314. new VerifyCoefficient() { CheckerId = 1, DoPersonId =11, Coefficient =0.5},
  315. new VerifyCoefficient() { CheckerId = 1, DoPersonId =12, Coefficient =0.5},
  316. new VerifyCoefficient() { CheckerId = 1, DoPersonId =13, Coefficient =0.6},
  317. new VerifyCoefficient() { CheckerId = 2, DoPersonId =5, Coefficient =0.2},
  318. new VerifyCoefficient() { CheckerId = 2, DoPersonId =6, Coefficient =0.2},
  319. new VerifyCoefficient() { CheckerId = 2, DoPersonId =7, Coefficient =0.2},
  320. new VerifyCoefficient() { CheckerId = 2, DoPersonId =8, Coefficient =0.2},
  321. new VerifyCoefficient() { CheckerId = 2, DoPersonId =9, Coefficient =0.3},
  322. new VerifyCoefficient() { CheckerId = 2, DoPersonId =10, Coefficient =0.3},
  323. new VerifyCoefficient() { CheckerId = 2, DoPersonId =11, Coefficient =0.4},
  324. new VerifyCoefficient() { CheckerId = 2, DoPersonId =12, Coefficient =0.4},
  325. new VerifyCoefficient() { CheckerId = 2, DoPersonId =13, Coefficient =0.5},
  326. new VerifyCoefficient() { CheckerId = 3, DoPersonId =5, Coefficient =0.2},
  327. new VerifyCoefficient() { CheckerId = 3, DoPersonId =6, Coefficient =0.2},
  328. new VerifyCoefficient() { CheckerId = 3, DoPersonId =7, Coefficient =0.2},
  329. new VerifyCoefficient() { CheckerId = 3, DoPersonId =8, Coefficient =0.2},
  330. new VerifyCoefficient() { CheckerId = 3, DoPersonId =9, Coefficient =0.3},
  331. new VerifyCoefficient() { CheckerId = 3, DoPersonId =10, Coefficient =0.3},
  332. new VerifyCoefficient() { CheckerId = 3, DoPersonId =11, Coefficient =0.4},
  333. new VerifyCoefficient() { CheckerId = 3, DoPersonId =12, Coefficient =0.4},
  334. new VerifyCoefficient() { CheckerId = 3, DoPersonId =13, Coefficient =0.5},
  335. new VerifyCoefficient() { CheckerId = 4, DoPersonId =5, Coefficient =0.2},
  336. new VerifyCoefficient() { CheckerId = 4, DoPersonId =6, Coefficient =0.2},
  337. new VerifyCoefficient() { CheckerId = 4, DoPersonId =7, Coefficient =0.2},
  338. new VerifyCoefficient() { CheckerId = 4, DoPersonId =8, Coefficient =0.2},
  339. new VerifyCoefficient() { CheckerId = 4, DoPersonId =9, Coefficient =0.3},
  340. new VerifyCoefficient() { CheckerId = 4, DoPersonId =10, Coefficient =0.3},
  341. new VerifyCoefficient() { CheckerId = 4, DoPersonId =11, Coefficient =0.4},
  342. new VerifyCoefficient() { CheckerId = 4, DoPersonId =12, Coefficient =0.4},
  343. new VerifyCoefficient() { CheckerId = 4, DoPersonId =13, Coefficient =0.5},
  344. new VerifyCoefficient() { CheckerId = 5, DoPersonId =5, Coefficient =0.2},
  345. new VerifyCoefficient() { CheckerId = 5, DoPersonId =6, Coefficient =0.2},
  346. new VerifyCoefficient() { CheckerId = 5, DoPersonId =7, Coefficient =0.2},
  347. new VerifyCoefficient() { CheckerId = 5, DoPersonId =8, Coefficient =0.2},
  348. new VerifyCoefficient() { CheckerId = 5, DoPersonId =9, Coefficient =0.3},
  349. new VerifyCoefficient() { CheckerId = 5, DoPersonId =10, Coefficient =0.3},
  350. new VerifyCoefficient() { CheckerId = 5, DoPersonId =11, Coefficient =0.4},
  351. new VerifyCoefficient() { CheckerId = 5, DoPersonId =12, Coefficient =0.4},
  352. new VerifyCoefficient() { CheckerId = 5, DoPersonId =13, Coefficient =0.5},
  353. new VerifyCoefficient() { CheckerId = 6, DoPersonId =5, Coefficient =0.2},
  354. new VerifyCoefficient() { CheckerId = 6, DoPersonId =6, Coefficient =0.2},
  355. new VerifyCoefficient() { CheckerId = 6, DoPersonId =7, Coefficient =0.2},
  356. new VerifyCoefficient() { CheckerId = 6, DoPersonId =8, Coefficient =0.2},
  357. new VerifyCoefficient() { CheckerId = 6, DoPersonId =9, Coefficient =0.3},
  358. new VerifyCoefficient() { CheckerId = 6, DoPersonId =10, Coefficient =0.3},
  359. new VerifyCoefficient() { CheckerId = 6, DoPersonId =11, Coefficient =0.4},
  360. new VerifyCoefficient() { CheckerId = 6, DoPersonId =12, Coefficient =0.4},
  361. new VerifyCoefficient() { CheckerId = 6, DoPersonId =13, Coefficient =0.5}
  362. }
  363. );
  364. BasePointRule[] rules = new BasePointRule[]
  365. {
  366. new BasePointRule(){Rule="p.DoItem==\"发明一次OA授权\" && p.ApplicationType==\"发明\"",PointExpress="0.2",Type="其它",Priority=1},
  367. new BasePointRule(){Rule="p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"发文后客户取消申请\"",PointExpress="0.49",Type="新申请",Priority=2},
  368. new BasePointRule(){Rule="p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"发文后客户取消申请\"",PointExpress="0.7",Type="新申请",Priority=3},
  369. new BasePointRule(){Rule="p.CaseNo.StartsWith(\"PADE\")  && p.AgentFeedbackMemo==\"发文后客户原因取消申请,系统结案\"",PointExpress="1.33",Type="新申请",Priority=4},
  370. new BasePointRule(){Rule="p.CaseNo.StartsWith(\"PAUS\")  && p.AgentFeedbackMemo==\"发文后客户原因取消申请,系统结案\"",PointExpress="1.26",Type="新申请",Priority=5},
  371. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"PCT首次英文案\"",PointExpress="1.8",Type="新申请",Priority=6},
  372. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"涉外实质改权\"",PointExpress="0.7",Type="新申请",Priority=7},
  373. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"首次中文案\"",PointExpress="1",Type="新申请",Priority=8},
  374. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"外-内首次申请\"",PointExpress="1.5",Type="新申请",Priority=9},
  375. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"",PointExpress="0.7",Type="新申请",Priority=10},
  376. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\"  && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"",PointExpress="1",Type="新申请",Priority=11},
  377. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"欧洲案首次\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAEPO\")",PointExpress="1.8",Type="新申请",Priority=12},
  378. new BasePointRule(){Rule="p.DoItem==\"新申请\"  && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-TS\")",PointExpress="1",Type="新申请",Priority=13},
  379. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\")",PointExpress="1",Type="新申请",Priority=14},
  380. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" &&  p.CaseNo.StartsWith(\"PACN\")",PointExpress="0.7",Type="新申请",Priority=15},
  381. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" &&  p.CaseNo.StartsWith(\"PACN\") && p.Customer.Name.Contains(\"OPPO\")",PointExpress="1",Type="新申请",Priority=16},
  382. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PADE\")",PointExpress="1.9",Type="新申请",Priority=17},
  383. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" &&  p.CaseNo.StartsWith(\"PADE\")",PointExpress="1.9",Type="新申请",Priority=18},
  384. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAGB\")",PointExpress="1.8",Type="新申请",Priority=19},
  385. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAUS\")",PointExpress="1.8",Type="新申请",Priority=20},
  386. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAUS\") && p.Customer.Name.Contains(\"OPPO\")",PointExpress="1.7",Type="新申请",Priority=21},
  387. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PCTCN\")",PointExpress="1.5",Type="新申请",Priority=22},
  388. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"英-中\" && p.WordCount !=null",PointExpress="p.WordCount/1000*0.1",Type="其它",Priority=23},
  389. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"中-英\" && p.WordCount !=null",PointExpress="p.WordCount/1000*0.16",Type="其它",Priority=24},
  390. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"中-德\" && p.WordCount !=null",PointExpress="p.WordCount/1000*0.18",Type="其它",Priority=25},
  391. new BasePointRule(){Rule="p.AgentFeedbackMemo==\"检索结案\"",PointExpress="0.2",Type="其它",Priority=26},
  392. new BasePointRule(){Rule="p.AgentFeedbackMemo==\"撰写中客户取消申请\"",PointExpress="0",Type="其它",Priority=27},
  393. new BasePointRule(){Rule="p.AgentFeedbackMemo==\"我方代交\"",PointExpress="0",Type="其它",Priority=28},
  394. new BasePointRule(){Rule="p.AgentFeedbackMemo==\"我方转格式、复核\"",PointExpress="0.2",Type="其它",Priority=29},
  395. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"改权\"",PointExpress="0.3",Type="其它",Priority=30},
  396. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"改权+改说明书\"",PointExpress="0.5",Type="其它",Priority=31},
  397. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"转格式\"",PointExpress="0.1",Type="其它",Priority=32},
  398. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\"  && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"",PointExpress="0.1",Type="其它",Priority=33},
  399. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"",PointExpress="0.1",Type="其它",Priority=34},
  400. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"台湾案转大陆案\"",PointExpress="0.2",Type="其它",Priority=35},
  401. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"大陆案转台湾案\"",PointExpress="0.2",Type="其它",Priority=36},
  402. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-分案\")",PointExpress="0.3",Type="其它",Priority=37},
  403. new BasePointRule(){Rule="p.CaseNo.StartsWith(\"PAUS\") && (p.CaseNo.EndsWith(\"-同套\") || p.CaseNo.EndsWith(\"CA\") || p.CaseNo.EndsWith(\"CIP\") || p.CaseNo.EndsWith(\"分案\"))",PointExpress="0.5",Type="其它",Priority=38},
  404. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" &&  p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-TS\")",PointExpress="0.1",Type="其它",Priority=39},
  405. new BasePointRule(){Rule="p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PAEPO\")",PointExpress="0.2",Type="其它",Priority=40},
  406. new BasePointRule(){Rule="(p.ApplicationType==\"实用新型\" || p.ApplicationType==\"发明\") && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"客户不进行答辩\"",PointExpress="0",Type="其它",Priority=41},
  407. new BasePointRule(){Rule="p.AgentFeedbackMemo==\"涉外OA不答辩,发报导函结案\"",PointExpress="0.1",Type="其它",Priority=42},
  408. new BasePointRule(){Rule="p.ApplicationType==\"外观设计\"",PointExpress="0.2",Type="其它",Priority=43},
  409. new BasePointRule(){Rule="p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"内-外\"",PointExpress="0.7",Type="其它",Priority=44},
  410. new BasePointRule(){Rule="p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"外-内\"",PointExpress="0.5",Type="其它",Priority=45},
  411. new BasePointRule(){Rule="p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"内-外\"",PointExpress="0.3",Type="其它",Priority=46},
  412. new BasePointRule(){Rule="p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"外-内\"",PointExpress="0.2",Type="其它",Priority=47},
  413. new BasePointRule(){Rule="p.AgentFeedbackMemo==\"检索结案\"",PointExpress="0.2",Type="其它",Priority=48},
  414. new BasePointRule(){Rule="p.DoItem==\"内部检索\"",PointExpress="0",Type="其它",Priority=49},
  415. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAAU\")",PointExpress="0.2",Type="其它",Priority=50},
  416. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PACN\")",PointExpress="0",Type="其它",Priority=51},
  417. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PCTCN\")",PointExpress="0",Type="其它",Priority=52},
  418. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"WOCN\")",PointExpress="0",Type="其它",Priority=53},
  419. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PADE\")",PointExpress="0.2",Type="其它",Priority=54},
  420. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAEPO\")",PointExpress="0.2",Type="其它",Priority=55},
  421. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAGB\")",PointExpress="0.2",Type="其它",Priority=56},
  422. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAIN\")",PointExpress="0.2",Type="其它",Priority=57},
  423. new BasePointRule(){Rule="p.DoItem.Contains(\"补正\")  && p.CaseNo.StartsWith(\"PAUS\")",PointExpress="0.2",Type="其它",Priority=58},
  424. new BasePointRule(){Rule="p.DoItem==\"Election Action\"",PointExpress="0.2",Type="其它",Priority=59},
  425. new BasePointRule(){Rule="p.DoItem==\"OA答辩校核\"",PointExpress="0.2",Type="其它",Priority=60},
  426. new BasePointRule(){Rule="p.DoItem==\"PPH\"",PointExpress="0.1",Type="其它",Priority=61},
  427. new BasePointRule(){Rule="p.DoItem==\"电询\"  && p.CaseNo.StartsWith(\"PACN\")",PointExpress="0",Type="其它",Priority=62},
  428. new BasePointRule(){Rule="p.DoItem==\"电询\"  && p.CaseNo.StartsWith(\"PAEPO\")",PointExpress="0.2",Type="其它",Priority=63},
  429. new BasePointRule(){Rule="p.DoItem==\"电询\"  && p.CaseNo.StartsWith(\"PAUS\")",PointExpress="0.2",Type="其它",Priority=64},
  430. new BasePointRule(){Rule="p.DoItem==\"分案评估\"",PointExpress="0.1",Type="其它",Priority=65},
  431. new BasePointRule(){Rule="p.DoItem==\"分案评估+分案\"",PointExpress="0.2",Type="其它",Priority=66},
  432. new BasePointRule(){Rule="p.DoItem==\"绘图\"",PointExpress="0",Type="其它",Priority=67},
  433. new BasePointRule(){Rule="p.DoItem==\"技术确认\"",PointExpress="0",Type="其它",Priority=68},
  434. new BasePointRule(){Rule="p.DoItem==\"提交ids\" || p.DoItem==\"提交IDS\"",PointExpress="0.1",Type="其它",Priority=69},
  435. new BasePointRule(){Rule="p.DoItem==\"询问放弃或复审\"",PointExpress="0",Type="其它",Priority=70},
  436. new BasePointRule(){Rule="p.DoItem==\"知识点总结\"",PointExpress="0",Type="其它",Priority=71},
  437. new BasePointRule(){Rule="p.DoItem==\"专利挖掘与布局\"",PointExpress="0",Type="其它",Priority=72},
  438. new BasePointRule(){Rule="p.ApplicationType==\"外观设计\"",PointExpress="0.2",Type="其它",Priority=73},
  439. new BasePointRule(){Rule="p.DoItem==\"请求优先审查\"",PointExpress="0",Type="其它",Priority=74},
  440. new BasePointRule(){Rule="p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"英-中\"",PointExpress="p.WordCount/1000*0.1",Type="其它",Priority=75},
  441. new BasePointRule(){Rule="p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"中-英\"",PointExpress="p.WordCount/1000*0.16",Type="其它",Priority=76},
  442. new BasePointRule(){Rule="p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"中-德\"",PointExpress="p.WordCount/1000*0.18",Type="其它",Priority=77},
  443. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"实用新型\"  && p.AgentFeedbackMemo==\"不请款\"",PointExpress="0",Type="OA",Priority=78},
  444. new BasePointRule(){Rule="p.ApplicationType==\"实用新型\"  && p.DoItemCoefficient==\"实质\" && (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\" || p.CaseStage==\"六通\" || p.CaseStage==\"七通\" || p.CaseStage==\"八通\")",PointExpress="0",Type="OA",Priority=79},
  445. new BasePointRule(){Rule="p.ApplicationType==\"实用新型\"  && p.DoItemCoefficient==\"实质\" && p.CaseStage==\"二通\" && p.AgentFeedbackMemo==\"请款\"",PointExpress="0.14",Type="OA",Priority=80},
  446. new BasePointRule(){Rule="p.ApplicationType==\"实用新型\"  && p.DoItemCoefficient==\"实质\" && p.CaseStage==\"一通\" && p.AgentFeedbackMemo==\"请款\"",PointExpress="0.35",Type="OA",Priority=81},
  447. new BasePointRule(){Rule="p.DoItem==\"请求复审\" && p.ApplicationType==\"实用新型\"  && p.AgentFeedbackMemo==\"请款\"",PointExpress="0.35",Type="OA",Priority=82},
  448. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"非实质\"  && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"",PointExpress="0.3",Type="OA",Priority=83},
  449. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"",PointExpress="0.5",Type="OA",Priority=84},
  450. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"",PointExpress="0.2",Type="OA",Priority=85},
  451. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"客户提供答辩点,撰写英文报导函\"",PointExpress="0.5",Type="OA",Priority=86},
  452. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"客户未提供答辩点,撰写英文报导函\"",PointExpress="0.8",Type="OA",Priority=87},
  453. new BasePointRule(){Rule="p.DoItem==\"Advisory Action\" && p.DoItemCoefficient==\"实质\"",PointExpress="1.5",Type="OA",Priority=88},
  454. new BasePointRule(){Rule="p.DoItem==\"Advisory Action\" && p.DoItemCoefficient==\"形式\"",PointExpress="0.2",Type="OA",Priority=89},
  455. new BasePointRule(){Rule="p.DoItem==\"Final Action\" && p.DoItemCoefficient==\"实质\"",PointExpress="1.5",Type="OA",Priority=90},
  456. new BasePointRule(){Rule="p.DoItem==\"Final Action\" && p.DoItemCoefficient==\"形式\"",PointExpress="0.2",Type="OA",Priority=91},
  457. new BasePointRule(){Rule="p.DoItem==\"form 3\"",PointExpress="0.1",Type="OA",Priority=92},
  458. new BasePointRule(){Rule="p.DoItem==\"form 3-8(2)\" ||  p.DoItem==\"Form 3-8(2)\"",PointExpress="0.1",Type="OA",Priority=93},
  459. new BasePointRule(){Rule="p.DoItem==\"Non Final Action\" && p.DoItemCoefficient==\"实质\"",PointExpress="1.5",Type="OA",Priority=94},
  460. new BasePointRule(){Rule="p.DoItem==\"Non Final Action\" && p.DoItemCoefficient==\"形式\"",PointExpress="0.2",Type="OA",Priority=95},
  461. new BasePointRule(){Rule="p.DoItem==\"RCE\" && p.DoItemCoefficient==\"实质\"",PointExpress="1.5",Type="OA",Priority=96},
  462. new BasePointRule(){Rule="p.DoItem==\"RCE\" && p.DoItemCoefficient==\"形式\"",PointExpress="0.2",Type="OA",Priority=97},
  463. new BasePointRule(){Rule="p.DoItem==\"欧洲案答辩\" && p.DoItemCoefficient==\"实质\"",PointExpress="1.5",Type="OA",Priority=98},
  464. new BasePointRule(){Rule="p.DoItem==\"欧洲案答辩\" && p.DoItemCoefficient==\"形式\"",PointExpress="0.2",Type="OA",Priority=99},
  465. new BasePointRule(){Rule="p.DoItem==\"口审评估\" && p.DoItemCoefficient==\"非实质\"",PointExpress="0.2",Type="OA",Priority=100},
  466. new BasePointRule(){Rule="p.DoItem==\"口审评估\" && p.DoItemCoefficient==\"实质\"",PointExpress="1.5",Type="OA",Priority=101},
  467. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAUS\")",PointExpress="1.5",Type="OA",Priority=102},
  468. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAUS\")",PointExpress="0.2",Type="OA",Priority=103},
  469. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAAU\")",PointExpress="1.5",Type="OA",Priority=104},
  470. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PADE\")",PointExpress="1.6",Type="OA",Priority=105},
  471. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAEPO\")",PointExpress="1.5",Type="OA",Priority=106},
  472. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAGB\")",PointExpress="1.5",Type="OA",Priority=107},
  473. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAIN\")",PointExpress="1.5",Type="OA",Priority=108},
  474. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAAU\")",PointExpress="0.2",Type="OA",Priority=109},
  475. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PADE\")",PointExpress="0.3",Type="OA",Priority=110},
  476. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAEPO\")",PointExpress="0.2",Type="OA",Priority=111},
  477. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAGB\")",PointExpress="0.2",Type="OA",Priority=112},
  478. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAIN\")",PointExpress="0.2",Type="OA",Priority=113},
  479. new BasePointRule(){Rule="p.DoItem==\"申復\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PATW\")",PointExpress="0.5",Type="OA",Priority=114},
  480. new BasePointRule(){Rule="p.DoItem==\"申復\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PATW\")",PointExpress="0.2",Type="OA",Priority=115},
  481. new BasePointRule(){Rule="p.DoItem==\"请求复审\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\")",PointExpress="0.5",Type="OA",Priority=116},
  482. new BasePointRule(){Rule="p.DoItem==\"意见陈述\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"复审\"",PointExpress="0.2",Type="OA",Priority=117},
  483. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"非实质\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"一通\"",PointExpress="0.3",Type="OA",Priority=118},
  484. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PACN\")  && p.CaseStage==\"一通\"",PointExpress="0.5",Type="OA",Priority=119},
  485. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"一通\"",PointExpress="0.2",Type="OA",Priority=120},
  486. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"非实质\" && p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"一通\"",PointExpress="0.3",Type="OA",Priority=121},
  487. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PCTCN\")  && p.CaseStage==\"一通\"",PointExpress="0.5",Type="OA",Priority=122},
  488. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"一通\"",PointExpress="0.2",Type="OA",Priority=123},
  489. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"二通\"",PointExpress="0.2",Type="OA",Priority=124},
  490. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" &&  p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"二通\"",PointExpress="0.2",Type="OA",Priority=125},
  491. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") &&  (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\")",PointExpress="0",Type="OA",Priority=126},
  492. new BasePointRule(){Rule="p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PCTCN\") &&  (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\")",PointExpress="0",Type="OA",Priority=127},
  493. new BasePointRule(){Rule="p.AgentFeedbackMemo==\"已核算绩效\"",PointExpress="0",Type="其它",Priority=128},
  494. };
  495. for(int i = 0; i < rules.Length ; i++)
  496. {
  497. rules[i].Id = i+1;
  498. }
  499. modelBuilder.Entity<BasePointRule>().HasData(rules);
  500. AppealType[] appealTypes = new AppealType[]
  501. {
  502. new AppealType(){Id=1, Name ="绩效点数分配比率",CanDoExpress = "p.ItemStaffs.Count()>1"},
  503. new AppealType(){Id=2,Name ="案件系数复核",CanDoExpress = "p.DoItem==\"新申请\"",ReviewerExpress ="p.Reviewer"},
  504. new AppealType(){Id=3,Name ="处理事项系数复核",CanDoExpress = "p.DoItem==\"新申请\"",ReviewerExpress ="p.Reviewer"},
  505. new AppealType(){Id=4,Name ="案件缺漏申诉",CanDoExpress ="",ReviewerExpress ="p.Reviewer",Type =1}
  506. };
  507. InputField[] inputFields = new InputField[] {
  508. new InputField(){Id=1,AppealTypeId =1,AppealState =0,FieldName ="分配比率", MapObjectField ="ItemStaffs.PerformancePoint",FieldType = typeof(double).ToString() },
  509. new InputField(){Id=2,AppealTypeId =1,AppealState =0,FieldName ="处理人", MapObjectField ="ItemStaffs.DoPerson.Name" ,FieldType =typeof(string).ToString() },
  510. new InputField(){Id=3,AppealTypeId =1,AppealState =0,FieldName ="原因",FieldType =typeof(string).ToString() },
  511. new InputField(){Id=4,AppealTypeId =1,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
  512. new InputField(){Id=5,AppealTypeId =1,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
  513. new InputField(){Id=6,AppealTypeId =2,AppealState =0,FieldName ="案件系数", MapObjectField ="CaseCoefficient",FieldType = typeof(double).ToString() },
  514. new InputField(){Id=9,AppealTypeId =2,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
  515. new InputField(){Id=10,AppealTypeId =2,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
  516. new InputField(){Id=11,AppealTypeId =3,AppealState =0,FieldName ="处理事项系数", MapObjectField ="DoItemCoefficient",FieldType = typeof(double).ToString() },
  517. new InputField(){Id=12,AppealTypeId =3,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
  518. new InputField(){Id=13,AppealTypeId =3,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
  519. new InputField(){Id=14,AppealTypeId =4,AppealState =0,FieldName ="我方文号", FieldType = typeof(double).ToString() },
  520. new InputField(){Id=15,AppealTypeId =4,AppealState =0,FieldName ="处理事项", FieldType = typeof(double).ToString() },
  521. new InputField(){Id=16,AppealTypeId =4,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
  522. new InputField(){Id=17,AppealTypeId =4,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()}
  523. };
  524. List<SelectValue> selectValues = new List<SelectValue>() {
  525. new SelectValue(){Id =1, InputFieldId =5, Value ="同意" },
  526. new SelectValue(){Id =2, InputFieldId =5, Value ="拒绝" },
  527. new SelectValue(){Id =3, InputFieldId =10, Value ="同意" },
  528. new SelectValue(){Id =4, InputFieldId =10, Value ="拒绝" },
  529. new SelectValue(){Id =5, InputFieldId =13, Value ="同意" },
  530. new SelectValue(){Id =6, InputFieldId =13, Value ="拒绝" },
  531. new SelectValue(){Id =7, InputFieldId =17, Value ="同意" },
  532. new SelectValue(){Id =8, InputFieldId =17, Value ="拒绝" }
  533. };
  534. modelBuilder.Entity<AppealType>().HasData(appealTypes);
  535. modelBuilder.Entity<InputField>().HasData(inputFields);
  536. modelBuilder.Entity<SelectValue>().HasData(selectValues);
  537. OnModelCreatingPartial(modelBuilder);
  538. }
  539. partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
  540. }
  541. }