maintenance_detail_item.dart 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. class MaintenanceDetailEntity {
  2. String createDate;
  3. String creatorId;
  4. String updateDate;
  5. String updateId;
  6. String id;
  7. String mtPlanId;
  8. String liftId;
  9. String projectId;
  10. String mtCompanyId;
  11. String workerId;
  12. String code;
  13. int liftType;
  14. int type;
  15. String planDate;
  16. String workDate;
  17. String stopDate;
  18. String recoveryDate;
  19. String maintenanceAdvice;
  20. String maintenanceOption;
  21. String position;
  22. String status;
  23. int isRegular;
  24. String workerId1;
  25. int isRepair;
  26. String repairReason;
  27. String signatureImg1;
  28. String signatureImg2;
  29. String sparepart;
  30. double partsCost;
  31. double manCost;
  32. String safetyConfirm;
  33. int hasEvaluate;
  34. List<MtRecordCosts> mtRecordCosts;
  35. String projectName;
  36. String projectCode;
  37. String mtCompanyName;
  38. String useCompanyCode;
  39. int category;
  40. String registrationCode;
  41. String workerName;
  42. int repairDiff;
  43. String repairDuration;
  44. List<MtOptions> mtOptions;
  45. List<MtRecordImgs> mtRecordImgs;
  46. Evaluation evaluation;
  47. MaintenanceDetailEntity(
  48. {this.createDate,
  49. this.creatorId,
  50. this.updateDate,
  51. this.updateId,
  52. this.id,
  53. this.mtPlanId,
  54. this.liftId,
  55. this.projectId,
  56. this.mtCompanyId,
  57. this.workerId,
  58. this.code,
  59. this.liftType,
  60. this.type,
  61. this.planDate,
  62. this.workDate,
  63. this.stopDate,
  64. this.recoveryDate,
  65. this.maintenanceAdvice,
  66. this.maintenanceOption,
  67. this.position,
  68. this.status,
  69. this.isRegular,
  70. this.workerId1,
  71. this.isRepair,
  72. this.repairReason,
  73. this.signatureImg1,
  74. this.signatureImg2,
  75. this.sparepart,
  76. this.partsCost,
  77. this.manCost,
  78. this.safetyConfirm,
  79. this.hasEvaluate,
  80. this.mtRecordCosts,
  81. this.projectName,
  82. this.projectCode,
  83. this.mtCompanyName,
  84. this.useCompanyCode,
  85. this.category,
  86. this.registrationCode,
  87. this.workerName,
  88. this.repairDiff,
  89. this.repairDuration,
  90. this.mtOptions,
  91. this.mtRecordImgs,
  92. this.evaluation});
  93. Map<String,int> getMaintenanceOptionArr(){
  94. Map<String,int> map = Map();
  95. List<String> list = maintenanceOption.replaceAll(" ", "").split(",");
  96. for (var i = 0; i < list.length; ++i) {
  97. var item = list[i];
  98. List<String> kv = item.split(":");
  99. map[kv[0]] = int.parse(kv[1]);
  100. }
  101. print("=================");
  102. print(map);
  103. print("=================");
  104. return map;
  105. }
  106. MaintenanceDetailEntity.fromJsonMap(Map<String, dynamic> json) {
  107. createDate = json['createDate'];
  108. creatorId = json['creatorId'];
  109. updateDate = json['updateDate'];
  110. updateId = json['updateId'];
  111. id = json['id'];
  112. mtPlanId = json['mtPlanId'];
  113. liftId = json['liftId'];
  114. projectId = json['projectId'];
  115. mtCompanyId = json['mtCompanyId'];
  116. workerId = json['workerId'];
  117. code = json['code'];
  118. liftType = json['liftType'];
  119. type = json['type'];
  120. planDate = json['planDate'];
  121. workDate = json['workDate'];
  122. stopDate = json['stopDate'];
  123. recoveryDate = json['recoveryDate'];
  124. maintenanceAdvice = json['maintenanceAdvice'];
  125. maintenanceOption = json['maintenanceOption'];
  126. position = json['position'];
  127. status = json['status'];
  128. isRegular = json['isRegular'];
  129. workerId1 = json['workerId1'];
  130. isRepair = json['isRepair'];
  131. repairReason = json['repairReason'];
  132. signatureImg1 = json['signatureImg1'];
  133. signatureImg2 = json['signatureImg2']??"";
  134. sparepart = json['sparepart'];
  135. partsCost = json['partsCost'];
  136. manCost = json['manCost'];
  137. safetyConfirm = json['safetyConfirm'];
  138. hasEvaluate = json['hasEvaluate'];
  139. if (json['mtRecordCosts'] != null) {
  140. mtRecordCosts = new List<MtRecordCosts>();
  141. json['mtRecordCosts'].forEach((v) {
  142. mtRecordCosts.add(new MtRecordCosts.fromJsonMap(v));
  143. });
  144. }
  145. projectName = json['projectName'];
  146. projectCode = json['projectCode'];
  147. mtCompanyName = json['mtCompanyName'];
  148. useCompanyCode = json['useCompanyCode'];
  149. category = json['category'];
  150. registrationCode = json['registrationCode'];
  151. workerName = json['workerName'];
  152. repairDiff = json['repairDiff'];
  153. repairDuration = json['repairDuration'];
  154. if (json['mtOptions'] != null) {
  155. mtOptions = new List<MtOptions>();
  156. json['mtOptions'].forEach((v) {
  157. mtOptions.add(new MtOptions.fromJsonMap(v));
  158. });
  159. }
  160. if (json['mtRecordImgs'] != null) {
  161. mtRecordImgs = new List<MtRecordImgs>();
  162. json['mtRecordImgs'].forEach((v) {
  163. mtRecordImgs.add(new MtRecordImgs.fromJsonMap(v));
  164. });
  165. }
  166. evaluation = json['evaluation'] != null
  167. ? new Evaluation.fromJsonMap(json['evaluation'])
  168. : null;
  169. }
  170. Map<String, dynamic> toJson() {
  171. final Map<String, dynamic> data = new Map<String, dynamic>();
  172. data['createDate'] = this.createDate;
  173. data['creatorId'] = this.creatorId;
  174. data['updateDate'] = this.updateDate;
  175. data['updateId'] = this.updateId;
  176. data['id'] = this.id;
  177. data['mtPlanId'] = this.mtPlanId;
  178. data['liftId'] = this.liftId;
  179. data['projectId'] = this.projectId;
  180. data['mtCompanyId'] = this.mtCompanyId;
  181. data['workerId'] = this.workerId;
  182. data['code'] = this.code;
  183. data['liftType'] = this.liftType;
  184. data['type'] = this.type;
  185. data['planDate'] = this.planDate;
  186. data['workDate'] = this.workDate;
  187. data['stopDate'] = this.stopDate;
  188. data['recoveryDate'] = this.recoveryDate;
  189. data['maintenanceAdvice'] = this.maintenanceAdvice;
  190. data['maintenanceOption'] = this.maintenanceOption;
  191. data['position'] = this.position;
  192. data['status'] = this.status;
  193. data['isRegular'] = this.isRegular;
  194. data['workerId1'] = this.workerId1;
  195. data['isRepair'] = this.isRepair;
  196. data['repairReason'] = this.repairReason;
  197. data['signatureImg1'] = this.signatureImg1;
  198. data['signatureImg2'] = this.signatureImg2;
  199. data['sparepart'] = this.sparepart;
  200. data['partsCost'] = this.partsCost;
  201. data['manCost'] = this.manCost;
  202. data['safetyConfirm'] = this.safetyConfirm;
  203. data['hasEvaluate'] = this.hasEvaluate;
  204. if (this.mtRecordCosts != null) {
  205. data['mtRecordCosts'] =
  206. this.mtRecordCosts.map((v) => v.toJson()).toList();
  207. }
  208. data['projectName'] = this.projectName;
  209. data['projectCode'] = this.projectCode;
  210. data['mtCompanyName'] = this.mtCompanyName;
  211. data['useCompanyCode'] = this.useCompanyCode;
  212. data['category'] = this.category;
  213. data['registrationCode'] = this.registrationCode;
  214. data['workerName'] = this.workerName;
  215. data['repairDiff'] = this.repairDiff;
  216. data['repairDuration'] = this.repairDuration;
  217. if (this.mtOptions != null) {
  218. data['mtOptions'] = this.mtOptions.map((v) => v.toJson()).toList();
  219. }
  220. if (this.mtRecordImgs != null) {
  221. data['mtRecordImgs'] = this.mtRecordImgs.map((v) => v.toJson()).toList();
  222. }
  223. if (this.evaluation != null) {
  224. data['evaluation'] = this.evaluation.toJson();
  225. }
  226. return data;
  227. }
  228. }
  229. class MtRecordCosts {
  230. String createDate;
  231. String updateDate;
  232. String id;
  233. String mtRecordId;
  234. String sparepart;
  235. int partsCost;
  236. int manCost;
  237. MtRecordCosts(
  238. {this.createDate,
  239. this.updateDate,
  240. this.id,
  241. this.mtRecordId,
  242. this.sparepart,
  243. this.partsCost,
  244. this.manCost});
  245. MtRecordCosts.fromJsonMap(Map<String, dynamic> json) {
  246. createDate = json['createDate'];
  247. updateDate = json['updateDate'];
  248. id = json['id'];
  249. mtRecordId = json['mtRecordId'];
  250. sparepart = json['sparepart'];
  251. partsCost = json['partsCost'];
  252. manCost = json['manCost'];
  253. }
  254. Map<String, dynamic> toJson() {
  255. final Map<String, dynamic> data = new Map<String, dynamic>();
  256. data['createDate'] = this.createDate;
  257. data['updateDate'] = this.updateDate;
  258. data['id'] = this.id;
  259. data['mtRecordId'] = this.mtRecordId;
  260. data['sparepart'] = this.sparepart;
  261. data['partsCost'] = this.partsCost;
  262. data['manCost'] = this.manCost;
  263. return data;
  264. }
  265. }
  266. class MtOptions {
  267. String id;
  268. String content;
  269. String mtCompanyId;
  270. int type;
  271. int liftCategory;
  272. int sort;
  273. int status;
  274. String signage;
  275. String item;
  276. int opt;
  277. MtOptions(
  278. {this.id,
  279. this.content,
  280. this.mtCompanyId,
  281. this.type,
  282. this.liftCategory,
  283. this.sort,
  284. this.status,
  285. this.signage,
  286. this.item,
  287. this.opt});
  288. MtOptions.fromJsonMap(Map<String, dynamic> json) {
  289. id = json['id'];
  290. content = json['content'];
  291. mtCompanyId = json['mtCompanyId'];
  292. type = json['type'];
  293. liftCategory = json['liftCategory'];
  294. sort = json['sort'];
  295. status = json['status'];
  296. signage = json['signage'];
  297. item = json['item'];
  298. opt = json['opt'];
  299. }
  300. Map<String, dynamic> toJson() {
  301. final Map<String, dynamic> data = new Map<String, dynamic>();
  302. data['id'] = this.id;
  303. data['content'] = this.content;
  304. data['mtCompanyId'] = this.mtCompanyId;
  305. data['type'] = this.type;
  306. data['liftCategory'] = this.liftCategory;
  307. data['sort'] = this.sort;
  308. data['status'] = this.status;
  309. data['signage'] = this.signage;
  310. data['item'] = this.item;
  311. data['opt'] = this.opt;
  312. return data;
  313. }
  314. }
  315. class MtRecordImgs {
  316. String id;
  317. String mtRecordId;
  318. String imgUrl;
  319. // int sort;
  320. MtRecordImgs({this.id, this.mtRecordId, this.imgUrl});
  321. MtRecordImgs.fromJsonMap(Map<String, dynamic> json) {
  322. id = json['id'];
  323. mtRecordId = json['mtRecordId'];
  324. imgUrl = json['imgUrl'];
  325. // sort = json['sort'];
  326. }
  327. Map<String, dynamic> toJson() {
  328. final Map<String, dynamic> data = new Map<String, dynamic>();
  329. data['id'] = this.id;
  330. data['mtRecordId'] = this.mtRecordId;
  331. data['imgUrl'] = this.imgUrl;
  332. // data['sort'] = this.sort;
  333. return data;
  334. }
  335. }
  336. class Evaluation {
  337. String id;
  338. String liftId;
  339. String recordId;
  340. int source;
  341. int type;
  342. String advice;
  343. int serviceLevel;
  344. int starLevel;
  345. String imgUrl;
  346. String postDate;
  347. String userId;
  348. Evaluation(
  349. {this.id,
  350. this.liftId,
  351. this.recordId,
  352. this.source,
  353. this.type,
  354. this.advice,
  355. this.serviceLevel,
  356. this.starLevel,
  357. this.imgUrl,
  358. this.postDate,
  359. this.userId});
  360. Evaluation.fromJsonMap(Map<String, dynamic> json) {
  361. id = json['id'];
  362. liftId = json['liftId'];
  363. recordId = json['recordId'];
  364. source = json['source'];
  365. type = json['type'];
  366. advice = json['advice'];
  367. serviceLevel = json['serviceLevel'];
  368. starLevel = json['starLevel'];
  369. imgUrl = json['imgUrl'];
  370. postDate = json['postDate'];
  371. userId = json['userId'];
  372. }
  373. Map<String, dynamic> toJson() {
  374. final Map<String, dynamic> data = new Map<String, dynamic>();
  375. data['id'] = this.id;
  376. data['liftId'] = this.liftId;
  377. data['recordId'] = this.recordId;
  378. data['source'] = this.source;
  379. data['type'] = this.type;
  380. data['advice'] = this.advice;
  381. data['serviceLevel'] = this.serviceLevel;
  382. data['starLevel'] = this.starLevel;
  383. data['imgUrl'] = this.imgUrl;
  384. data['postDate'] = this.postDate;
  385. data['userId'] = this.userId;
  386. return data;
  387. }
  388. }
  389. class MaintenanceCache{
  390. String id;
  391. String options;
  392. String advice;
  393. String sign1;
  394. String sign2;
  395. List<String> images;
  396. MaintenanceCache(
  397. {this.id="",
  398. this.options="",
  399. this.advice="",
  400. this.sign1="",
  401. this.sign2="",
  402. this.images});
  403. Map<String,int> getMaintenanceOptionArr(){
  404. Map<String,int> map = Map();
  405. if(!options.contains(",")){
  406. return map;
  407. }
  408. List<String> list = options.replaceAll(" ", "").split(",");
  409. for (var i = 0; i < list.length; ++i) {
  410. var item = list[i];
  411. List<String> kv = item.split(":");
  412. map[kv[0]] = int.parse(kv[1]);
  413. }
  414. print("=================");
  415. print(map);
  416. print("=================");
  417. return map;
  418. }
  419. MaintenanceCache.fromJsonMap(Map<String, dynamic> json) {
  420. id = json['id'];
  421. options = json['options'];
  422. advice = json['advice'];
  423. sign1 = json['sign1'];
  424. sign2 = json['sign2'];
  425. images = json['images'].cast<String>();
  426. }
  427. Map<String, dynamic> toJson() {
  428. final Map<String, dynamic> data = new Map<String, dynamic>();
  429. data['id'] = this.id;
  430. data['options'] = this.options;
  431. data['advice'] = this.advice;
  432. data['sign1'] = this.sign1;
  433. data['sign2'] = this.sign2;
  434. data['images'] = this.images;
  435. return data;
  436. }
  437. }