repair_list_entity.dart 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. class RepairListEntity {
  2. int pageNum;
  3. int pageCount;
  4. int total;
  5. int pageSize;
  6. bool hasNext;
  7. bool hasPrev;
  8. List<RepairItem> rows;
  9. RepairListEntity.fromJsonMap(Map<String, dynamic> map):
  10. pageNum = map["pageNum"],
  11. pageCount = map["pageCount"],
  12. total = map["total"],
  13. pageSize = map["pageSize"],
  14. hasNext = map["hasNext"],
  15. hasPrev = map["hasPrev"],
  16. rows = List<RepairItem>.from(map["rows"].map((it) => RepairItem.fromJsonMap(it)));
  17. Map<String, dynamic> toJson() {
  18. final Map<String, dynamic> data = new Map<String, dynamic>();
  19. data['pageNum'] = pageNum;
  20. data['pageCount'] = pageCount;
  21. data['total'] = total;
  22. data['pageSize'] = pageSize;
  23. data['hasNext'] = hasNext;
  24. data['hasPrev'] = hasPrev;
  25. data['rows'] = rows != null ?
  26. this.rows.map((v) => v.toJson()).toList()
  27. : null;
  28. return data;
  29. }
  30. }
  31. class RepairItem {
  32. String createDate;
  33. String creatorId;
  34. String updateDate;
  35. String updateId;
  36. String id;
  37. String mtCompanyId;
  38. String liftId;
  39. String projectId;
  40. int isTrapped;
  41. int isCritical;
  42. String callerFaultDescription;
  43. int source;
  44. String callerId;
  45. String callerName;
  46. String callerTel;
  47. String callerDate;
  48. String stopDate;
  49. String assignTime;
  50. String takingTime;
  51. String arriveTime;
  52. String recoveryDate;
  53. String sparepart;
  54. String charge;
  55. String workerFaultDescription;
  56. String fieldDescription;
  57. String repairProcedure;
  58. String workerId;
  59. String workerTel;
  60. String position;
  61. int status;
  62. String readTime;
  63. int repairReason;
  64. String partsCost;
  65. String safetyConfirm;
  66. String workerId1;
  67. String costTotal;
  68. String closeReason;
  69. String faultPart;
  70. String faultReason;
  71. String faultHandle;
  72. String faultNature;
  73. String faultDuty;
  74. String mainSign;
  75. String secondSign;
  76. int hasEvaluate;
  77. String areaName;
  78. String projectName;
  79. String projectCode;
  80. String registrationCode;
  81. String devicePosition;
  82. String useCompanyCode;
  83. int liftCategory;
  84. String liftCode;
  85. String workerName;
  86. String createName;
  87. String liftCompanyStatus;
  88. // List<Object> erRecordCosts;
  89. int repairDiff;
  90. String repairDuration;
  91. List<FaultItem> faultParts;
  92. List<FaultItem> faultReasons;
  93. List<FaultItem> faultHandles;
  94. List<FaultItem> faultNatures;
  95. List<FaultItem> faultDuties;
  96. Evaluation evaluation;
  97. List<ErRecordImgs> erRecordImgs;
  98. String getLiftCategory(){
  99. String str = "";
  100. switch(liftCategory){
  101. case 1:
  102. str = "曳引梯";
  103. break;
  104. case 2:
  105. str = "液压梯";
  106. break;
  107. case 3:
  108. str = "杂物梯";
  109. break;
  110. case 4:
  111. str = "自动扶梯";
  112. break;
  113. case 5:
  114. str = "自动人行道";
  115. break;
  116. }
  117. return str;
  118. }
  119. RepairItem.fromJsonMap(Map<String, dynamic> map):
  120. createDate = map["createDate"],
  121. creatorId = map["creatorId"],
  122. updateDate = map["updateDate"],
  123. updateId = map["updateId"],
  124. id = map["id"],
  125. mtCompanyId = map["mtCompanyId"],
  126. liftId = map["liftId"],
  127. projectId = map["projectId"]??"",
  128. isTrapped = map["isTrapped"]??0,
  129. isCritical = map["isCritical"]??0,
  130. callerFaultDescription = map["callerFaultDescription"]??"",
  131. source = map["source"]??0,
  132. callerId = map["callerId"]??"",
  133. callerName = map["callerName"]??"",
  134. callerTel = map["callerTel"],
  135. callerDate = map["callerDate"]??"",
  136. stopDate = map["stopDate"]??"",
  137. assignTime = map["assignTime"]??"",
  138. takingTime = map["takingTime"]??"",
  139. arriveTime = map["arriveTime"]??"",
  140. recoveryDate = map["recoveryDate"]??"",
  141. sparepart = map["sparepart"],
  142. charge = map["charge"],
  143. workerFaultDescription = map["workerFaultDescription"],
  144. fieldDescription = map["fieldDescription"],
  145. repairProcedure = map["repairProcedure"],
  146. workerId = map["workerId"],
  147. workerTel = map["workerTel"],
  148. position = map["position"],
  149. status = map["status"],
  150. readTime = map["readTime"],
  151. repairReason = map["repairReason"],
  152. partsCost = "${map["partsCost"]}",
  153. safetyConfirm = map["safetyConfirm"],
  154. workerId1 = map["workerId1"],
  155. costTotal = "${map["costTotal"]}",
  156. closeReason = map["closeReason"],
  157. faultPart = map["faultPart"],
  158. faultReason = map["faultReason"],
  159. faultHandle = map["faultHandle"],
  160. faultNature = map["faultNature"],
  161. faultDuty = map["faultDuty"],
  162. mainSign = map["mainSign"],
  163. secondSign = map["secondSign"],
  164. hasEvaluate = map["hasEvaluate"],
  165. areaName = map["areaName"],
  166. projectName = map["projectName"],
  167. projectCode = map["projectCode"],
  168. registrationCode = map["registrationCode"],
  169. devicePosition = map["devicePosition"],
  170. useCompanyCode = map["useCompanyCode"],
  171. liftCategory = map["liftCategory"],
  172. liftCode = map["liftCode"],
  173. workerName = map["workerName"],
  174. createName = map["createName"],
  175. liftCompanyStatus = map["liftCompanyStatus"],
  176. repairDiff = map["repairDiff"],
  177. repairDuration = map["repairDuration"],
  178. faultParts = List<FaultItem>.from((map["faultParts"]??[]).map((it) => FaultItem.fromJsonMap(it))),
  179. faultReasons = List<FaultItem>.from((map["faultReasons"]??[]).map((it) => FaultItem.fromJsonMap(it))),
  180. faultHandles =List<FaultItem>.from((map["faultHandles"]??[]).map((it) => FaultItem.fromJsonMap(it))),
  181. faultNatures =List<FaultItem>.from((map["faultNatures"]??[]).map((it) => FaultItem.fromJsonMap(it))),
  182. faultDuties = List<FaultItem>.from((map["faultDuties"]??[]).map((it) => FaultItem.fromJsonMap(it))),
  183. evaluation = Evaluation.fromJsonMap(map["evaluation"]??{}),
  184. erRecordImgs = List<ErRecordImgs>.from((map["erRecordImgs"]??[]).map((it) => ErRecordImgs.fromJsonMap(it)));
  185. Map<String, dynamic> toJson() {
  186. final Map<String, dynamic> data = new Map<String, dynamic>();
  187. data['createDate'] = createDate;
  188. data['creatorId'] = creatorId;
  189. data['updateDate'] = updateDate;
  190. data['updateId'] = updateId;
  191. data['id'] = id;
  192. data['mtCompanyId'] = mtCompanyId;
  193. data['liftId'] = liftId;
  194. data['projectId'] = projectId;
  195. data['isTrapped'] = isTrapped;
  196. data['isCritical'] = isCritical;
  197. data['callerFaultDescription'] = callerFaultDescription;
  198. data['source'] = source;
  199. data['callerId'] = callerId;
  200. data['callerName'] = callerName;
  201. data['callerTel'] = callerTel;
  202. data['callerDate'] = callerDate;
  203. data['stopDate'] = stopDate;
  204. data['assignTime'] = assignTime;
  205. data['takingTime'] = takingTime;
  206. data['arriveTime'] = arriveTime;
  207. data['recoveryDate'] = recoveryDate;
  208. data['sparepart'] = sparepart;
  209. data['charge'] = charge;
  210. data['workerFaultDescription'] = workerFaultDescription;
  211. data['fieldDescription'] = fieldDescription;
  212. data['repairProcedure'] = repairProcedure;
  213. data['workerId'] = workerId;
  214. data['workerTel'] = workerTel;
  215. data['position'] = position;
  216. data['status'] = status;
  217. data['readTime'] = readTime;
  218. data['repairReason'] = repairReason;
  219. data['partsCost'] = partsCost;
  220. data['safetyConfirm'] = safetyConfirm;
  221. data['workerId1'] = workerId1;
  222. data['costTotal'] = costTotal;
  223. data['closeReason'] = closeReason;
  224. data['faultPart'] = faultPart;
  225. data['faultReason'] = faultReason;
  226. data['faultHandle'] = faultHandle;
  227. data['faultNature'] = faultNature;
  228. data['faultDuty'] = faultDuty;
  229. data['mainSign'] = mainSign;
  230. data['secondSign'] = secondSign;
  231. data['hasEvaluate'] = hasEvaluate;
  232. data['areaName'] = areaName;
  233. data['projectName'] = projectName;
  234. data['projectCode'] = projectCode;
  235. data['registrationCode'] = registrationCode;
  236. data['devicePosition'] = devicePosition;
  237. data['useCompanyCode'] = useCompanyCode;
  238. data['liftCategory'] = liftCategory;
  239. data['liftCode'] = liftCode;
  240. data['workerName'] = workerName;
  241. data['createName'] = createName;
  242. data['liftCompanyStatus'] = liftCompanyStatus;
  243. data['repairDiff'] = repairDiff;
  244. data['repairDuration'] = repairDuration;
  245. data['faultParts'] = faultParts;
  246. data['faultReasons'] = faultReasons;
  247. data['faultHandles'] = faultHandles;
  248. data['faultNatures'] = faultNatures;
  249. data['faultDuties'] = faultDuties;
  250. data['evaluation'] = evaluation;
  251. data['erRecordImgs'] = erRecordImgs != null ?
  252. this.erRecordImgs.map((v) => v.toJson()).toList()
  253. : null;
  254. return data;
  255. }
  256. }
  257. class ErRecordImgs {
  258. String id;
  259. String erRecordId;
  260. String imgUrl;
  261. int sort;
  262. ErRecordImgs.fromJsonMap(Map<String, dynamic> map):
  263. id = map["id"],
  264. erRecordId = map["erRecordId"],
  265. imgUrl = map["imgUrl"],
  266. sort = map["sort"];
  267. Map<String, dynamic> toJson() {
  268. final Map<String, dynamic> data = new Map<String, dynamic>();
  269. data['id'] = id;
  270. data['erRecordId'] = erRecordId;
  271. data['imgUrl'] = imgUrl;
  272. data['sort'] = sort;
  273. return data;
  274. }
  275. }
  276. class FaultItem {
  277. String id;
  278. String code;
  279. int liftCategory;
  280. String faultCategory;
  281. String faultType;
  282. String faultDesc;
  283. FaultItem.fromJsonMap(Map<String, dynamic> map):
  284. id = map["id"],
  285. code = map["code"],
  286. liftCategory = map["liftCategory"],
  287. faultCategory = map["faultCategory"],
  288. faultType = map["faultType"],
  289. faultDesc = map["faultDesc"];
  290. Map<String, dynamic> toJson() {
  291. final Map<String, dynamic> data = new Map<String, dynamic>();
  292. data['id'] = id;
  293. data['code'] = code;
  294. data['liftCategory'] = liftCategory;
  295. data['faultCategory'] = faultCategory;
  296. data['faultType'] = faultType;
  297. data['faultDesc'] = faultDesc;
  298. return data;
  299. }
  300. }
  301. class Evaluation{
  302. String id;
  303. String liftId;
  304. String recordId;
  305. int source;
  306. int type;
  307. String advice;
  308. int serviceLevel;
  309. int starLevel;
  310. String imgUrl;
  311. String postDate;
  312. String userId;
  313. Evaluation(
  314. {this.id,
  315. this.liftId,
  316. this.recordId,
  317. this.source,
  318. this.type,
  319. this.advice,
  320. this.serviceLevel,
  321. this.starLevel,
  322. this.imgUrl,
  323. this.postDate,
  324. this.userId});
  325. Evaluation.fromJsonMap(Map<String, dynamic> json) {
  326. id = json['id'];
  327. liftId = json['liftId'];
  328. recordId = json['recordId'];
  329. source = json['source'];
  330. type = json['type'];
  331. advice = json['advice'];
  332. serviceLevel = json['serviceLevel'];
  333. starLevel = json['starLevel'];
  334. imgUrl = json['imgUrl'];
  335. postDate = json['postDate'];
  336. userId = json['userId'];
  337. }
  338. Map<String, dynamic> toJson() {
  339. final Map<String, dynamic> data = new Map<String, dynamic>();
  340. data['id'] = this.id;
  341. data['liftId'] = this.liftId;
  342. data['recordId'] = this.recordId;
  343. data['source'] = this.source;
  344. data['type'] = this.type;
  345. data['advice'] = this.advice;
  346. data['serviceLevel'] = this.serviceLevel;
  347. data['starLevel'] = this.starLevel;
  348. data['imgUrl'] = this.imgUrl;
  349. data['postDate'] = this.postDate;
  350. data['userId'] = this.userId;
  351. return data;
  352. }
  353. }
  354. class RepairCreateItem {
  355. String projectId;
  356. String projectName;
  357. String registrationCode;
  358. String liftId;
  359. String callerName;
  360. String callerTel;
  361. String callerDate;
  362. String callerFaultDescription;
  363. int isTrapped;//是否关人(0 否;1 是)
  364. int isCritical;//是否紧急(0 否;1 是)
  365. int repairReason;//急修原因(0 其他;1 停电;2 故障)
  366. RepairCreateItem({
  367. this.projectId="",
  368. this.projectName="",
  369. this.registrationCode="",
  370. this.liftId="",
  371. this.callerName="",
  372. this.callerTel="",
  373. this.callerDate="",
  374. this.callerFaultDescription="",
  375. this.isTrapped=0,
  376. this.isCritical=0,
  377. this.repairReason=0,
  378. });
  379. }