20211115011112_addCaseCeoffcient.cs 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace wispro.sp.api.Migrations
  4. {
  5. public partial class addCaseCeoffcient : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "AppealType",
  11. columns: table => new
  12. {
  13. Id = table.Column<int>(type: "int", nullable: false)
  14. .Annotation("SqlServer:Identity", "1, 1"),
  15. Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  16. CanDoExpress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  17. ReviewerExpress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  18. Type = table.Column<int>(type: "int", nullable: false)
  19. },
  20. constraints: table =>
  21. {
  22. table.PrimaryKey("PK_AppealType", x => x.Id);
  23. });
  24. migrationBuilder.CreateTable(
  25. name: "BasePointRule",
  26. columns: table => new
  27. {
  28. Id = table.Column<int>(type: "int", nullable: false)
  29. .Annotation("SqlServer:Identity", "1, 1"),
  30. Rule = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
  31. PointExpress = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
  32. Priority = table.Column<int>(type: "int", nullable: false),
  33. Type = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true)
  34. },
  35. constraints: table =>
  36. {
  37. table.PrimaryKey("PK_BasePointRule", x => x.Id);
  38. });
  39. migrationBuilder.CreateTable(
  40. name: "CalMonth",
  41. columns: table => new
  42. {
  43. Id = table.Column<int>(type: "int", nullable: false)
  44. .Annotation("SqlServer:Identity", "1, 1"),
  45. year = table.Column<int>(type: "int", nullable: false),
  46. month = table.Column<int>(type: "int", nullable: false),
  47. status = table.Column<int>(type: "int", nullable: false)
  48. },
  49. constraints: table =>
  50. {
  51. table.PrimaryKey("PK_CalMonth", x => x.Id);
  52. });
  53. migrationBuilder.CreateTable(
  54. name: "CaseCeofficient",
  55. columns: table => new
  56. {
  57. Ceoffcient = table.Column<string>(type: "nvarchar(450)", nullable: false),
  58. Value = table.Column<double>(type: "float", nullable: false)
  59. },
  60. constraints: table =>
  61. {
  62. table.PrimaryKey("PK_CaseCeofficient", x => x.Ceoffcient);
  63. });
  64. migrationBuilder.CreateTable(
  65. name: "StaffGrade",
  66. columns: table => new
  67. {
  68. Id = table.Column<int>(type: "int", nullable: false)
  69. .Annotation("SqlServer:Identity", "1, 1"),
  70. Grade = table.Column<string>(type: "nchar(5)", fixedLength: true, maxLength: 5, nullable: false),
  71. Coefficient = table.Column<double>(type: "float", nullable: false)
  72. },
  73. constraints: table =>
  74. {
  75. table.PrimaryKey("PK_StaffGrade", x => x.Id);
  76. });
  77. migrationBuilder.CreateTable(
  78. name: "InputField",
  79. columns: table => new
  80. {
  81. Id = table.Column<int>(type: "int", nullable: false)
  82. .Annotation("SqlServer:Identity", "1, 1"),
  83. FieldName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  84. FieldType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  85. MapObjectField = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  86. MapObjectFieldLabel = table.Column<string>(type: "nvarchar(max)", nullable: true),
  87. AppealTypeId = table.Column<int>(type: "int", nullable: false),
  88. AppealState = table.Column<int>(type: "int", nullable: false),
  89. CanMuliSelect = table.Column<bool>(type: "bit", nullable: false),
  90. MaxSize = table.Column<int>(type: "int", nullable: true)
  91. },
  92. constraints: table =>
  93. {
  94. table.PrimaryKey("PK_InputField", x => x.Id);
  95. table.ForeignKey(
  96. name: "FK_InputField_AppealType_AppealTypeId",
  97. column: x => x.AppealTypeId,
  98. principalTable: "AppealType",
  99. principalColumn: "Id",
  100. onDelete: ReferentialAction.Cascade);
  101. });
  102. migrationBuilder.CreateTable(
  103. name: "Staff",
  104. columns: table => new
  105. {
  106. Id = table.Column<int>(type: "int", nullable: false)
  107. .Annotation("SqlServer:Identity", "1, 1"),
  108. Account = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  109. Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
  110. Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  111. Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
  112. Tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
  113. Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
  114. IsOnJob = table.Column<bool>(type: "bit", nullable: false),
  115. Status = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: false),
  116. isCalPerformsnce = table.Column<bool>(type: "bit", nullable: false),
  117. StaffGradeId = table.Column<int>(type: "int", nullable: true),
  118. Department = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  119. WorkPlace = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  120. EntyDate = table.Column<DateTime>(type: "date", nullable: true),
  121. Mail = table.Column<string>(type: "nvarchar(max)", nullable: true),
  122. Memo = table.Column<string>(type: "nvarchar(max)", nullable: true)
  123. },
  124. constraints: table =>
  125. {
  126. table.PrimaryKey("PK_Staff", x => x.Id);
  127. table.ForeignKey(
  128. name: "FK_Staff_StaffGrade",
  129. column: x => x.StaffGradeId,
  130. principalTable: "StaffGrade",
  131. principalColumn: "Id",
  132. onDelete: ReferentialAction.Restrict);
  133. });
  134. migrationBuilder.CreateTable(
  135. name: "VerifyCoefficient",
  136. columns: table => new
  137. {
  138. CheckerId = table.Column<int>(type: "int", nullable: false),
  139. DoPersonId = table.Column<int>(type: "int", nullable: false),
  140. Coefficient = table.Column<double>(type: "float", nullable: false)
  141. },
  142. constraints: table =>
  143. {
  144. table.PrimaryKey("PK_VerifyCoefficient", x => new { x.CheckerId, x.DoPersonId });
  145. table.ForeignKey(
  146. name: "FK_VerifyCoefficient_StaffGrade",
  147. column: x => x.CheckerId,
  148. principalTable: "StaffGrade",
  149. principalColumn: "Id",
  150. onDelete: ReferentialAction.Restrict);
  151. table.ForeignKey(
  152. name: "FK_VerifyCoefficient_StaffGrade1",
  153. column: x => x.DoPersonId,
  154. principalTable: "StaffGrade",
  155. principalColumn: "Id",
  156. onDelete: ReferentialAction.Restrict);
  157. });
  158. migrationBuilder.CreateTable(
  159. name: "SelectValue",
  160. columns: table => new
  161. {
  162. Id = table.Column<int>(type: "int", nullable: false)
  163. .Annotation("SqlServer:Identity", "1, 1"),
  164. Value = table.Column<string>(type: "nvarchar(max)", nullable: true),
  165. InputFieldId = table.Column<int>(type: "int", nullable: false)
  166. },
  167. constraints: table =>
  168. {
  169. table.PrimaryKey("PK_SelectValue", x => x.Id);
  170. table.ForeignKey(
  171. name: "FK_SelectValue_InputField_InputFieldId",
  172. column: x => x.InputFieldId,
  173. principalTable: "InputField",
  174. principalColumn: "Id",
  175. onDelete: ReferentialAction.Cascade);
  176. });
  177. migrationBuilder.CreateTable(
  178. name: "Customer",
  179. columns: table => new
  180. {
  181. Id = table.Column<int>(type: "int", nullable: false)
  182. .Annotation("SqlServer:Identity", "1, 1"),
  183. Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
  184. ContactMan = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  185. Address = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  186. Phone = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  187. ResponseManId = table.Column<int>(type: "int", nullable: true)
  188. },
  189. constraints: table =>
  190. {
  191. table.PrimaryKey("PK_Customer", x => x.Id);
  192. table.ForeignKey(
  193. name: "FK_Customer_Staff",
  194. column: x => x.ResponseManId,
  195. principalTable: "Staff",
  196. principalColumn: "Id",
  197. onDelete: ReferentialAction.Restrict);
  198. });
  199. migrationBuilder.CreateTable(
  200. name: "Message",
  201. columns: table => new
  202. {
  203. Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  204. MessageInfo = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  205. Type = table.Column<int>(type: "int", nullable: false),
  206. FromId = table.Column<int>(type: "int", nullable: false)
  207. },
  208. constraints: table =>
  209. {
  210. table.PrimaryKey("PK_Message", x => x.Id);
  211. table.ForeignKey(
  212. name: "FK_From_Staff",
  213. column: x => x.FromId,
  214. principalTable: "Staff",
  215. principalColumn: "Id",
  216. onDelete: ReferentialAction.Restrict);
  217. });
  218. migrationBuilder.CreateTable(
  219. name: "PerformanceItem",
  220. columns: table => new
  221. {
  222. Id = table.Column<int>(type: "int", nullable: false)
  223. .Annotation("SqlServer:Identity", "1, 1"),
  224. CaseNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  225. ApplicationType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  226. BusinessType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  227. AgentFeedbackMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  228. DoItem = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  229. CaseStage = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  230. CaseCoefficient = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
  231. DoItemCoefficient = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  232. PreOAStaffId = table.Column<int>(type: "int", nullable: true),
  233. ReviewerId = table.Column<int>(type: "int", nullable: true),
  234. CustomerId = table.Column<int>(type: "int", nullable: true),
  235. ApplicationName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
  236. FinishedDate = table.Column<DateTime>(type: "date", nullable: true),
  237. FinalizationDate = table.Column<DateTime>(type: "date", nullable: true),
  238. ReturnDate = table.Column<DateTime>(type: "date", nullable: true),
  239. CaseType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  240. CaseState = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  241. DoItemMemo = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  242. DoItemState = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  243. CaseName = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  244. CustomerLimitDate = table.Column<DateTime>(type: "date", nullable: true),
  245. EntrustingDate = table.Column<DateTime>(type: "date", nullable: true),
  246. InternalDate = table.Column<DateTime>(type: "date", nullable: true),
  247. FirstDraftDate = table.Column<DateTime>(type: "date", nullable: true),
  248. OverDueMemo = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
  249. BasePoint = table.Column<decimal>(type: "numeric(18,2)", nullable: true),
  250. Status = table.Column<int>(type: "int", nullable: true),
  251. CaseMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  252. WordCount = table.Column<int>(type: "int", nullable: true),
  253. ReturnCasseNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  254. Type = table.Column<string>(type: "nvarchar(max)", nullable: true),
  255. CalMonthId = table.Column<int>(type: "int", nullable: false)
  256. },
  257. constraints: table =>
  258. {
  259. table.PrimaryKey("PK_PerformanceItem", x => x.Id);
  260. table.ForeignKey(
  261. name: "FK_PerformanceItem_CalMonth",
  262. column: x => x.CalMonthId,
  263. principalTable: "CalMonth",
  264. principalColumn: "Id",
  265. onDelete: ReferentialAction.Cascade);
  266. table.ForeignKey(
  267. name: "FK_PerformanceItem_Customer",
  268. column: x => x.CustomerId,
  269. principalTable: "Customer",
  270. principalColumn: "Id",
  271. onDelete: ReferentialAction.Restrict);
  272. table.ForeignKey(
  273. name: "FK_PerformanceItem_Reviewer",
  274. column: x => x.ReviewerId,
  275. principalTable: "Staff",
  276. principalColumn: "Id",
  277. onDelete: ReferentialAction.Restrict);
  278. table.ForeignKey(
  279. name: "FK_PerformanceItem_Staff",
  280. column: x => x.PreOAStaffId,
  281. principalTable: "Staff",
  282. principalColumn: "Id",
  283. onDelete: ReferentialAction.Restrict);
  284. });
  285. migrationBuilder.CreateTable(
  286. name: "MessageReadRecord",
  287. columns: table => new
  288. {
  289. MessageId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  290. StaffId = table.Column<int>(type: "int", nullable: false),
  291. isReaded = table.Column<bool>(type: "bit", nullable: false),
  292. MessageId1 = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
  293. },
  294. constraints: table =>
  295. {
  296. table.PrimaryKey("PK_MessageReadRecord", x => new { x.MessageId, x.StaffId });
  297. table.ForeignKey(
  298. name: "FK_MessageReadRecord_Message",
  299. column: x => x.MessageId,
  300. principalTable: "Message",
  301. principalColumn: "Id",
  302. onDelete: ReferentialAction.Restrict);
  303. table.ForeignKey(
  304. name: "FK_MessageReadRecord_Message_MessageId1",
  305. column: x => x.MessageId1,
  306. principalTable: "Message",
  307. principalColumn: "Id",
  308. onDelete: ReferentialAction.Restrict);
  309. table.ForeignKey(
  310. name: "FK_MessageReadRecord_Staff",
  311. column: x => x.StaffId,
  312. principalTable: "Staff",
  313. principalColumn: "Id",
  314. onDelete: ReferentialAction.Restrict);
  315. });
  316. migrationBuilder.CreateTable(
  317. name: "AppealRecord",
  318. columns: table => new
  319. {
  320. Id = table.Column<int>(type: "int", nullable: false)
  321. .Annotation("SqlServer:Identity", "1, 1"),
  322. CreaterId = table.Column<int>(type: "int", nullable: false),
  323. CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
  324. Reason = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  325. State = table.Column<int>(type: "int", nullable: false),
  326. ReviewerId = table.Column<int>(type: "int", nullable: true),
  327. ReviewerMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  328. ReviewTime = table.Column<DateTime>(type: "datetime2", nullable: true),
  329. TypeId = table.Column<int>(type: "int", nullable: false),
  330. ItemId = table.Column<int>(type: "int", nullable: false)
  331. },
  332. constraints: table =>
  333. {
  334. table.PrimaryKey("PK_AppealRecord", x => x.Id);
  335. table.ForeignKey(
  336. name: "FK_AppealRecord_AppealType_TypeId",
  337. column: x => x.TypeId,
  338. principalTable: "AppealType",
  339. principalColumn: "Id");
  340. table.ForeignKey(
  341. name: "FK_AppealRecord_PerformanceItem_ItemId",
  342. column: x => x.ItemId,
  343. principalTable: "PerformanceItem",
  344. principalColumn: "Id",
  345. onDelete: ReferentialAction.Cascade);
  346. table.ForeignKey(
  347. name: "FK_AppealRecord_Staff_CreaterId",
  348. column: x => x.CreaterId,
  349. principalTable: "Staff",
  350. principalColumn: "Id",
  351. onDelete: ReferentialAction.Cascade);
  352. table.ForeignKey(
  353. name: "FK_AppealRecord_Staff_ReviewerId",
  354. column: x => x.ReviewerId,
  355. principalTable: "Staff",
  356. principalColumn: "Id");
  357. });
  358. migrationBuilder.CreateTable(
  359. name: "ItemStaff",
  360. columns: table => new
  361. {
  362. ItemId = table.Column<int>(type: "int", nullable: false),
  363. DoPersonId = table.Column<int>(type: "int", nullable: false),
  364. PerformancePoint = table.Column<double>(type: "float", nullable: true)
  365. },
  366. constraints: table =>
  367. {
  368. table.PrimaryKey("PK_ItemStaff", x => new { x.ItemId, x.DoPersonId });
  369. table.ForeignKey(
  370. name: "FK_ItemStaff_PerformanceItem",
  371. column: x => x.ItemId,
  372. principalTable: "PerformanceItem",
  373. principalColumn: "Id",
  374. onDelete: ReferentialAction.Restrict);
  375. table.ForeignKey(
  376. name: "FK_ItemStaff_Staff",
  377. column: x => x.DoPersonId,
  378. principalTable: "Staff",
  379. principalColumn: "Id",
  380. onDelete: ReferentialAction.Restrict);
  381. });
  382. migrationBuilder.CreateTable(
  383. name: "MessagePerformanceItems",
  384. columns: table => new
  385. {
  386. MessageId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  387. ItemId = table.Column<int>(type: "int", nullable: false)
  388. },
  389. constraints: table =>
  390. {
  391. table.PrimaryKey("PK_MessagePerformanceItems", x => new { x.ItemId, x.MessageId });
  392. table.ForeignKey(
  393. name: "FK_MessagePerformanceItem_Item",
  394. column: x => x.ItemId,
  395. principalTable: "PerformanceItem",
  396. principalColumn: "Id",
  397. onDelete: ReferentialAction.Cascade);
  398. table.ForeignKey(
  399. name: "FK_MessagePerformanceItem_Message",
  400. column: x => x.MessageId,
  401. principalTable: "Message",
  402. principalColumn: "Id",
  403. onDelete: ReferentialAction.Cascade);
  404. });
  405. migrationBuilder.CreateTable(
  406. name: "AttachFile",
  407. columns: table => new
  408. {
  409. Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  410. Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
  411. SavePath = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
  412. UploadUserId = table.Column<int>(type: "int", nullable: false),
  413. AppealRecordId = table.Column<int>(type: "int", nullable: true)
  414. },
  415. constraints: table =>
  416. {
  417. table.PrimaryKey("PK_AttachFile", x => x.Id);
  418. table.ForeignKey(
  419. name: "FK_AttachFile_AppealRecord",
  420. column: x => x.AppealRecordId,
  421. principalTable: "AppealRecord",
  422. principalColumn: "Id",
  423. onDelete: ReferentialAction.Restrict);
  424. table.ForeignKey(
  425. name: "FK_AttachFile_UpdateUser",
  426. column: x => x.UploadUserId,
  427. principalTable: "Staff",
  428. principalColumn: "Id");
  429. });
  430. migrationBuilder.CreateTable(
  431. name: "InputFieldValue",
  432. columns: table => new
  433. {
  434. Id = table.Column<int>(type: "int", nullable: false)
  435. .Annotation("SqlServer:Identity", "1, 1"),
  436. InputFieldId = table.Column<int>(type: "int", nullable: false),
  437. Label = table.Column<string>(type: "nvarchar(max)", nullable: true),
  438. Value = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  439. AppealRecordId = table.Column<int>(type: "int", nullable: false),
  440. mapExpress = table.Column<string>(type: "nvarchar(max)", nullable: true)
  441. },
  442. constraints: table =>
  443. {
  444. table.PrimaryKey("PK_InputFieldValue", x => x.Id);
  445. table.ForeignKey(
  446. name: "FK_InputFieldValue_AppealRecord_AppealRecordId",
  447. column: x => x.AppealRecordId,
  448. principalTable: "AppealRecord",
  449. principalColumn: "Id",
  450. onDelete: ReferentialAction.Cascade);
  451. table.ForeignKey(
  452. name: "FK_InputFieldValue_InputField_InputFieldId",
  453. column: x => x.InputFieldId,
  454. principalTable: "InputField",
  455. principalColumn: "Id",
  456. onDelete: ReferentialAction.Cascade);
  457. });
  458. migrationBuilder.InsertData(
  459. table: "AppealType",
  460. columns: new[] { "Id", "CanDoExpress", "Name", "ReviewerExpress", "Type" },
  461. values: new object[,]
  462. {
  463. { 1, "p.ItemStaffs.Count()>1", "绩效点数分配比率", null, 0 },
  464. { 2, "p.DoItem==\"新申请\"", "案件系数复核", "p.Reviewer", 0 },
  465. { 3, "p.DoItem==\"新申请\"", "处理事项系数复核", "p.Reviewer", 0 },
  466. { 4, "", "案件缺漏申诉", "p.Reviewer", 1 },
  467. { 5, "p.isDanger()", "案件严重超期说明", null, 0 },
  468. { 6, "p.DoItem==\"新申请\" || p.DoItem==\"翻译\"", "按照翻译字数算绩效备注", null, 0 }
  469. });
  470. migrationBuilder.InsertData(
  471. table: "CaseCeofficient",
  472. columns: new[] { "Ceoffcient", "Value" },
  473. values: new object[,]
  474. {
  475. { "D", 0.40000000000000002 },
  476. { "C", 0.69999999999999996 },
  477. { "B", 1.0 },
  478. { "A", 1.5 },
  479. { "S", 2.5 }
  480. });
  481. migrationBuilder.InsertData(
  482. table: "StaffGrade",
  483. columns: new[] { "Id", "Coefficient", "Grade" },
  484. values: new object[,]
  485. {
  486. { 14, 1.1000000000000001, "A级" },
  487. { 13, 0.5, "D1级" },
  488. { 12, 0.59999999999999998, "D2级" },
  489. { 11, 0.59999999999999998, "D3级" },
  490. { 10, 0.69999999999999996, "C1级" },
  491. { 9, 0.69999999999999996, "C2级" },
  492. { 8, 0.90000000000000002, "C3级" },
  493. { 3, 1.1000000000000001, "A2级" },
  494. { 6, 1.0, "B2级" },
  495. { 5, 1.0, "B3级" },
  496. { 4, 1.1000000000000001, "A1级" },
  497. { 15, 1.0, "C级" },
  498. { 2, 1.1000000000000001, "A3级" },
  499. { 1, 1.2, "S级" },
  500. { 7, 0.90000000000000002, "B1级" },
  501. { 16, 0.90000000000000002, "D级" }
  502. });
  503. migrationBuilder.InsertData(
  504. table: "InputField",
  505. columns: new[] { "Id", "AppealState", "AppealTypeId", "CanMuliSelect", "FieldName", "FieldType", "MapObjectField", "MapObjectFieldLabel", "MaxSize" },
  506. values: new object[,]
  507. {
  508. { 1, 0, 1, false, "分配比率", "System.Double", "ItemStaffs.PerformancePoint", "ItemStaffs.DoPerson.Name", null },
  509. { 24, 1, 6, false, "翻译字数", "System.Int32", "WordCount", null, null },
  510. { 23, 1, 6, false, "审核意见", "System.Int32", null, null, null },
  511. { 20, 0, 6, false, "翻译字数", "System.Int32", "WordCount", null, null },
  512. { 19, 0, 6, false, "翻译类型", "System.String", "AgentFeedbackMemo", null, null },
  513. { 21, 1, 5, false, "审核意见", "System.String", null, null, null },
  514. { 18, 0, 5, false, "超期说明", "System.String", "OverDueMemo", null, null },
  515. { 17, 1, 4, false, "审核意见", "System.String", null, null, null },
  516. { 16, 1, 4, false, "备注", "System.String", null, null, null },
  517. { 15, 0, 4, false, "处理事项", "System.String", null, null, null },
  518. { 22, 1, 5, false, "备注", "System.String", null, null, null },
  519. { 13, 1, 3, false, "审核意见", "System.String", null, null, null },
  520. { 12, 1, 3, false, "备注", "System.String", null, null, null },
  521. { 11, 0, 3, false, "处理事项系数", "System.String", "DoItemCoefficient", null, null },
  522. { 10, 1, 2, false, "审核意见", "System.String", null, null, null },
  523. { 9, 1, 2, false, "备注", "System.String", null, null, null },
  524. { 6, 0, 2, false, "案件系数", "System.String", "CaseCoefficient", null, null },
  525. { 5, 1, 1, false, "审核意见", "System.String", null, null, null },
  526. { 4, 1, 1, false, "备注", "System.String", null, null, null },
  527. { 3, 0, 1, false, "原因", "System.String", null, null, null },
  528. { 14, 0, 4, false, "我方文号", "System.String", null, null, null }
  529. });
  530. migrationBuilder.InsertData(
  531. table: "VerifyCoefficient",
  532. columns: new[] { "CheckerId", "DoPersonId", "Coefficient" },
  533. values: new object[,]
  534. {
  535. { 2, 11, 0.40000000000000002 },
  536. { 1, 11, 0.5 },
  537. { 6, 10, 0.29999999999999999 },
  538. { 5, 10, 0.29999999999999999 },
  539. { 4, 10, 0.29999999999999999 },
  540. { 5, 9, 0.29999999999999999 },
  541. { 2, 10, 0.29999999999999999 },
  542. { 1, 10, 0.40000000000000002 },
  543. { 6, 9, 0.29999999999999999 },
  544. { 3, 11, 0.40000000000000002 },
  545. { 3, 10, 0.29999999999999999 },
  546. { 4, 11, 0.40000000000000002 },
  547. { 2, 13, 0.5 },
  548. { 6, 11, 0.40000000000000002 },
  549. { 1, 12, 0.5 },
  550. { 2, 12, 0.40000000000000002 },
  551. { 3, 12, 0.40000000000000002 },
  552. { 4, 12, 0.40000000000000002 },
  553. { 5, 12, 0.40000000000000002 },
  554. { 6, 12, 0.40000000000000002 },
  555. { 1, 13, 0.59999999999999998 }
  556. });
  557. migrationBuilder.InsertData(
  558. table: "VerifyCoefficient",
  559. columns: new[] { "CheckerId", "DoPersonId", "Coefficient" },
  560. values: new object[,]
  561. {
  562. { 4, 9, 0.29999999999999999 },
  563. { 3, 13, 0.5 },
  564. { 4, 13, 0.5 },
  565. { 5, 11, 0.40000000000000002 },
  566. { 3, 9, 0.29999999999999999 },
  567. { 5, 7, 0.20000000000000001 },
  568. { 1, 9, 0.40000000000000002 },
  569. { 1, 5, 0.29999999999999999 },
  570. { 2, 5, 0.20000000000000001 },
  571. { 3, 5, 0.20000000000000001 },
  572. { 4, 5, 0.20000000000000001 },
  573. { 5, 5, 0.20000000000000001 },
  574. { 1, 6, 0.29999999999999999 },
  575. { 2, 6, 0.20000000000000001 },
  576. { 3, 6, 0.20000000000000001 },
  577. { 4, 6, 0.20000000000000001 },
  578. { 5, 6, 0.20000000000000001 },
  579. { 6, 5, 0.20000000000000001 },
  580. { 2, 9, 0.29999999999999999 },
  581. { 6, 6, 0.20000000000000001 },
  582. { 2, 7, 0.20000000000000001 },
  583. { 3, 7, 0.20000000000000001 },
  584. { 4, 7, 0.20000000000000001 },
  585. { 5, 13, 0.5 },
  586. { 6, 7, 0.20000000000000001 },
  587. { 1, 8, 0.29999999999999999 },
  588. { 2, 8, 0.20000000000000001 },
  589. { 3, 8, 0.20000000000000001 },
  590. { 4, 8, 0.20000000000000001 },
  591. { 5, 8, 0.20000000000000001 },
  592. { 6, 8, 0.20000000000000001 },
  593. { 1, 7, 0.29999999999999999 },
  594. { 6, 13, 0.5 }
  595. });
  596. migrationBuilder.InsertData(
  597. table: "SelectValue",
  598. columns: new[] { "Id", "InputFieldId", "Value" },
  599. values: new object[,]
  600. {
  601. { 1, 5, "同意" },
  602. { 16, 19, "中-德" },
  603. { 20, 22, "拒绝" },
  604. { 19, 22, "同意" },
  605. { 8, 17, "拒绝" },
  606. { 7, 17, "同意" },
  607. { 6, 13, "拒绝" },
  608. { 5, 13, "同意" },
  609. { 15, 11, "形式" },
  610. { 14, 11, "实质" },
  611. { 4, 10, "拒绝" },
  612. { 3, 10, "同意" },
  613. { 13, 6, "D" },
  614. { 12, 6, "C" },
  615. { 11, 6, "B" },
  616. { 10, 6, "A" },
  617. { 9, 6, "S" },
  618. { 2, 5, "拒绝" },
  619. { 17, 19, "中-英" },
  620. { 18, 19, "英-中" }
  621. });
  622. migrationBuilder.CreateIndex(
  623. name: "IX_AppealRecord_CreaterId",
  624. table: "AppealRecord",
  625. column: "CreaterId");
  626. migrationBuilder.CreateIndex(
  627. name: "IX_AppealRecord_ItemId",
  628. table: "AppealRecord",
  629. column: "ItemId");
  630. migrationBuilder.CreateIndex(
  631. name: "IX_AppealRecord_ReviewerId",
  632. table: "AppealRecord",
  633. column: "ReviewerId");
  634. migrationBuilder.CreateIndex(
  635. name: "IX_AppealRecord_TypeId",
  636. table: "AppealRecord",
  637. column: "TypeId");
  638. migrationBuilder.CreateIndex(
  639. name: "IX_AttachFile_AppealRecordId",
  640. table: "AttachFile",
  641. column: "AppealRecordId");
  642. migrationBuilder.CreateIndex(
  643. name: "IX_AttachFile_UploadUserId",
  644. table: "AttachFile",
  645. column: "UploadUserId");
  646. migrationBuilder.CreateIndex(
  647. name: "IX_Customer_ResponseManId",
  648. table: "Customer",
  649. column: "ResponseManId");
  650. migrationBuilder.CreateIndex(
  651. name: "IX_InputField_AppealTypeId",
  652. table: "InputField",
  653. column: "AppealTypeId");
  654. migrationBuilder.CreateIndex(
  655. name: "IX_InputFieldValue_AppealRecordId",
  656. table: "InputFieldValue",
  657. column: "AppealRecordId");
  658. migrationBuilder.CreateIndex(
  659. name: "IX_InputFieldValue_InputFieldId",
  660. table: "InputFieldValue",
  661. column: "InputFieldId");
  662. migrationBuilder.CreateIndex(
  663. name: "IX_ItemStaff_DoPersonId",
  664. table: "ItemStaff",
  665. column: "DoPersonId");
  666. migrationBuilder.CreateIndex(
  667. name: "IX_Message_FromId",
  668. table: "Message",
  669. column: "FromId");
  670. migrationBuilder.CreateIndex(
  671. name: "IX_MessagePerformanceItems_MessageId",
  672. table: "MessagePerformanceItems",
  673. column: "MessageId");
  674. migrationBuilder.CreateIndex(
  675. name: "IX_MessageReadRecord_MessageId1",
  676. table: "MessageReadRecord",
  677. column: "MessageId1");
  678. migrationBuilder.CreateIndex(
  679. name: "IX_MessageReadRecord_StaffId",
  680. table: "MessageReadRecord",
  681. column: "StaffId");
  682. migrationBuilder.CreateIndex(
  683. name: "IX_PerformanceItem_CalMonthId",
  684. table: "PerformanceItem",
  685. column: "CalMonthId");
  686. migrationBuilder.CreateIndex(
  687. name: "IX_PerformanceItem_CustomerId",
  688. table: "PerformanceItem",
  689. column: "CustomerId");
  690. migrationBuilder.CreateIndex(
  691. name: "IX_PerformanceItem_PreOAStaffId",
  692. table: "PerformanceItem",
  693. column: "PreOAStaffId");
  694. migrationBuilder.CreateIndex(
  695. name: "IX_PerformanceItem_ReviewerId",
  696. table: "PerformanceItem",
  697. column: "ReviewerId");
  698. migrationBuilder.CreateIndex(
  699. name: "IX_SelectValue_InputFieldId",
  700. table: "SelectValue",
  701. column: "InputFieldId");
  702. migrationBuilder.CreateIndex(
  703. name: "IX_Staff_StaffGradeId",
  704. table: "Staff",
  705. column: "StaffGradeId");
  706. migrationBuilder.CreateIndex(
  707. name: "IX_VerifyCoefficient_DoPersonId",
  708. table: "VerifyCoefficient",
  709. column: "DoPersonId");
  710. }
  711. protected override void Down(MigrationBuilder migrationBuilder)
  712. {
  713. migrationBuilder.DropTable(
  714. name: "AttachFile");
  715. migrationBuilder.DropTable(
  716. name: "BasePointRule");
  717. migrationBuilder.DropTable(
  718. name: "CaseCeofficient");
  719. migrationBuilder.DropTable(
  720. name: "InputFieldValue");
  721. migrationBuilder.DropTable(
  722. name: "ItemStaff");
  723. migrationBuilder.DropTable(
  724. name: "MessagePerformanceItems");
  725. migrationBuilder.DropTable(
  726. name: "MessageReadRecord");
  727. migrationBuilder.DropTable(
  728. name: "SelectValue");
  729. migrationBuilder.DropTable(
  730. name: "VerifyCoefficient");
  731. migrationBuilder.DropTable(
  732. name: "AppealRecord");
  733. migrationBuilder.DropTable(
  734. name: "Message");
  735. migrationBuilder.DropTable(
  736. name: "InputField");
  737. migrationBuilder.DropTable(
  738. name: "PerformanceItem");
  739. migrationBuilder.DropTable(
  740. name: "AppealType");
  741. migrationBuilder.DropTable(
  742. name: "CalMonth");
  743. migrationBuilder.DropTable(
  744. name: "Customer");
  745. migrationBuilder.DropTable(
  746. name: "Staff");
  747. migrationBuilder.DropTable(
  748. name: "StaffGrade");
  749. }
  750. }
  751. }