json_convert_content.dart 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. // ignore_for_file: non_constant_identifier_names
  2. // ignore_for_file: camel_case_types
  3. // ignore_for_file: prefer_single_quotes
  4. // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
  5. import 'package:flutter/material.dart' show debugPrint;
  6. import 'package:domain/entity/response/add_edit_revise_view_s_g_entity.dart';
  7. import 'package:domain/entity/response/attendance_entity.dart';
  8. import 'package:domain/entity/response/check_success_entity.dart';
  9. import 'package:domain/entity/response/device_list_entity.dart';
  10. import 'package:domain/entity/response/fiance_report_entity.dart';
  11. import 'package:domain/entity/response/hotel_info_entity.dart';
  12. import 'package:domain/entity/response/id_name_entity.dart';
  13. import 'package:domain/entity/response/job_applied_edit_index_s_g_entity.dart';
  14. import 'package:domain/entity/response/job_applied_index_s_g_entity.dart';
  15. import 'package:domain/entity/response/job_applied_list_s_g_entity.dart';
  16. import 'package:domain/entity/response/job_applied_remark_view_s_g_entity.dart';
  17. import 'package:domain/entity/response/job_applied_staff_s_g_entity.dart';
  18. import 'package:domain/entity/response/job_list_add_staff_entity.dart';
  19. import 'package:domain/entity/response/job_list_applied_edit_entity.dart';
  20. import 'package:domain/entity/response/job_list_applied_info_entity.dart';
  21. import 'package:domain/entity/response/job_list_applied_staff_list_entity.dart';
  22. import 'package:domain/entity/response/job_list_applied_staff_search_entity.dart';
  23. import 'package:domain/entity/response/job_list_applied_work_flow_entity.dart';
  24. import 'package:domain/entity/response/job_list_detail_entity.dart';
  25. import 'package:domain/entity/response/job_list_edit_index_s_g_entity.dart';
  26. import 'package:domain/entity/response/job_list_entity.dart';
  27. import 'package:domain/entity/response/job_list_index_entity.dart';
  28. import 'package:domain/entity/response/job_list_index_s_g_entity.dart';
  29. import 'package:domain/entity/response/job_list_remark_view_entity.dart';
  30. import 'package:domain/entity/response/job_list_s_g_entity.dart';
  31. import 'package:domain/entity/response/job_template_edit_index_entity.dart';
  32. import 'package:domain/entity/response/job_template_s_g_entity.dart';
  33. import 'package:domain/entity/response/job_title_edit_index_entity.dart';
  34. import 'package:domain/entity/response/job_title_s_g_entity.dart';
  35. import 'package:domain/entity/response/labour_report_entity.dart';
  36. import 'package:domain/entity/response/labour_report_v_n_entity.dart';
  37. import 'package:domain/entity/response/labour_request_edit_index_entity.dart';
  38. import 'package:domain/entity/response/labour_request_index_entity.dart';
  39. import 'package:domain/entity/response/labour_request_list_entity.dart';
  40. import 'package:domain/entity/response/labour_request_s_g_add_index_entity.dart';
  41. import 'package:domain/entity/response/labour_request_s_g_entity.dart';
  42. import 'package:domain/entity/response/labour_request_work_flow_entity.dart';
  43. import 'package:domain/entity/response/revise_index_s_g_entity.dart';
  44. import 'package:domain/entity/response/revise_list_s_g_entity.dart';
  45. import 'package:domain/entity/response/revise_log_s_g_entity.dart';
  46. import 'package:domain/entity/response/staff_detail_entity.dart';
  47. import 'package:domain/entity/response/staff_detail_s_g_entity.dart';
  48. import 'package:domain/entity/response/staff_job_history_s_g_entity.dart';
  49. import 'package:domain/entity/response/staff_labour_history_entity.dart';
  50. import 'package:domain/entity/response/staff_remark_history_entity.dart';
  51. import 'package:domain/entity/response/staff_report_v_n_entity.dart';
  52. import 'package:domain/entity/response/staff_request_report_entity.dart';
  53. import 'package:domain/entity/response/staff_review_history_s_g_entity.dart';
  54. import 'package:domain/entity/server_time.dart';
  55. JsonConvert jsonConvert = JsonConvert();
  56. typedef JsonConvertFunction<T> = T Function(Map<String, dynamic> json);
  57. typedef EnumConvertFunction<T> = T Function(String value);
  58. typedef ConvertExceptionHandler = void Function(Object error, StackTrace stackTrace);
  59. extension MapSafeExt<K, V> on Map<K, V> {
  60. T? getOrNull<T>(K? key) {
  61. if (!containsKey(key) || key == null) {
  62. return null;
  63. } else {
  64. return this[key] as T?;
  65. }
  66. }
  67. }
  68. class JsonConvert {
  69. static ConvertExceptionHandler? onError;
  70. JsonConvertClassCollection convertFuncMap = JsonConvertClassCollection();
  71. /// When you are in the development, to generate a new model class, hot-reload doesn't find new generation model class, you can build on MaterialApp method called jsonConvert. ReassembleConvertFuncMap (); This method only works in a development environment
  72. /// https://flutter.cn/docs/development/tools/hot-reload
  73. /// class MyApp extends StatelessWidget {
  74. /// const MyApp({Key? key})
  75. /// : super(key: key);
  76. ///
  77. /// @override
  78. /// Widget build(BuildContext context) {
  79. /// jsonConvert.reassembleConvertFuncMap();
  80. /// return MaterialApp();
  81. /// }
  82. /// }
  83. void reassembleConvertFuncMap() {
  84. bool isReleaseMode = const bool.fromEnvironment('dart.vm.product');
  85. if (!isReleaseMode) {
  86. convertFuncMap = JsonConvertClassCollection();
  87. }
  88. }
  89. T? convert<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
  90. if (value == null) {
  91. return null;
  92. }
  93. if (value is T) {
  94. return value;
  95. }
  96. try {
  97. return _asT<T>(value, enumConvert: enumConvert);
  98. } catch (e, stackTrace) {
  99. debugPrint('asT<$T> $e $stackTrace');
  100. if (onError != null) {
  101. onError!(e, stackTrace);
  102. }
  103. return null;
  104. }
  105. }
  106. List<T?>? convertList<T>(List<dynamic>? value, {EnumConvertFunction? enumConvert}) {
  107. if (value == null) {
  108. return null;
  109. }
  110. try {
  111. return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)).toList();
  112. } catch (e, stackTrace) {
  113. debugPrint('asT<$T> $e $stackTrace');
  114. if (onError != null) {
  115. onError!(e, stackTrace);
  116. }
  117. return <T>[];
  118. }
  119. }
  120. List<T>? convertListNotNull<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
  121. if (value == null) {
  122. return null;
  123. }
  124. try {
  125. return (value as List<dynamic>).map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)!).toList();
  126. } catch (e, stackTrace) {
  127. debugPrint('asT<$T> $e $stackTrace');
  128. if (onError != null) {
  129. onError!(e, stackTrace);
  130. }
  131. return <T>[];
  132. }
  133. }
  134. T? _asT<T extends Object?>(dynamic value,
  135. {EnumConvertFunction? enumConvert}) {
  136. final String type = T.toString();
  137. final String valueS = value.toString();
  138. if (enumConvert != null) {
  139. return enumConvert(valueS) as T;
  140. } else if (type == "String") {
  141. return valueS as T;
  142. } else if (type == "int") {
  143. final int? intValue = int.tryParse(valueS);
  144. if (intValue == null) {
  145. return double.tryParse(valueS)?.toInt() as T?;
  146. } else {
  147. return intValue as T;
  148. }
  149. } else if (type == "double") {
  150. return double.parse(valueS) as T;
  151. } else if (type == "DateTime") {
  152. return DateTime.parse(valueS) as T;
  153. } else if (type == "bool") {
  154. if (valueS == '0' || valueS == '1') {
  155. return (valueS == '1') as T;
  156. }
  157. return (valueS == 'true') as T;
  158. } else if (type == "Map" || type.startsWith("Map<")) {
  159. return value as T;
  160. } else {
  161. if (convertFuncMap.containsKey(type)) {
  162. if (value == null) {
  163. return null;
  164. }
  165. var covertFunc = convertFuncMap[type]!;
  166. if (covertFunc is Map<String, dynamic>) {
  167. return covertFunc(value as Map<String, dynamic>) as T;
  168. } else {
  169. return covertFunc(Map<String, dynamic>.from(value)) as T;
  170. }
  171. } else {
  172. throw UnimplementedError('$type unimplemented,you can try running the app again');
  173. }
  174. }
  175. }
  176. //list is returned by type
  177. static M? _getListChildType<M>(List<Map<String, dynamic>> data) {
  178. if (<AddEditReviseViewSGEntity>[] is M) {
  179. return data.map<AddEditReviseViewSGEntity>((Map<String, dynamic> e) => AddEditReviseViewSGEntity.fromJson(e)).toList() as M;
  180. }
  181. if (<AttendanceEntity>[] is M) {
  182. return data.map<AttendanceEntity>((Map<String, dynamic> e) => AttendanceEntity.fromJson(e)).toList() as M;
  183. }
  184. if (<AttendanceList>[] is M) {
  185. return data.map<AttendanceList>((Map<String, dynamic> e) => AttendanceList.fromJson(e)).toList() as M;
  186. }
  187. if (<CheckSuccessEntity>[] is M) {
  188. return data.map<CheckSuccessEntity>((Map<String, dynamic> e) => CheckSuccessEntity.fromJson(e)).toList() as M;
  189. }
  190. if (<DeviceListEntity>[] is M) {
  191. return data.map<DeviceListEntity>((Map<String, dynamic> e) => DeviceListEntity.fromJson(e)).toList() as M;
  192. }
  193. if (<DeviceListRows>[] is M) {
  194. return data.map<DeviceListRows>((Map<String, dynamic> e) => DeviceListRows.fromJson(e)).toList() as M;
  195. }
  196. if (<FianceReportEntity>[] is M) {
  197. return data.map<FianceReportEntity>((Map<String, dynamic> e) => FianceReportEntity.fromJson(e)).toList() as M;
  198. }
  199. if (<FianceReportRateList>[] is M) {
  200. return data.map<FianceReportRateList>((Map<String, dynamic> e) => FianceReportRateList.fromJson(e)).toList() as M;
  201. }
  202. if (<HotelInfoEntity>[] is M) {
  203. return data.map<HotelInfoEntity>((Map<String, dynamic> e) => HotelInfoEntity.fromJson(e)).toList() as M;
  204. }
  205. if (<HotelInfoMenus>[] is M) {
  206. return data.map<HotelInfoMenus>((Map<String, dynamic> e) => HotelInfoMenus.fromJson(e)).toList() as M;
  207. }
  208. if (<HotelInfoMenusChildren>[] is M) {
  209. return data.map<HotelInfoMenusChildren>((Map<String, dynamic> e) => HotelInfoMenusChildren.fromJson(e)).toList() as M;
  210. }
  211. if (<IdNameEntity>[] is M) {
  212. return data.map<IdNameEntity>((Map<String, dynamic> e) => IdNameEntity.fromJson(e)).toList() as M;
  213. }
  214. if (<JobAppliedEditIndexSGEntity>[] is M) {
  215. return data.map<JobAppliedEditIndexSGEntity>((Map<String, dynamic> e) => JobAppliedEditIndexSGEntity.fromJson(e)).toList() as M;
  216. }
  217. if (<JobAppliedEditIndexSGStatusList>[] is M) {
  218. return data.map<JobAppliedEditIndexSGStatusList>((Map<String, dynamic> e) => JobAppliedEditIndexSGStatusList.fromJson(e)).toList() as M;
  219. }
  220. if (<JobAppliedIndexSGEntity>[] is M) {
  221. return data.map<JobAppliedIndexSGEntity>((Map<String, dynamic> e) => JobAppliedIndexSGEntity.fromJson(e)).toList() as M;
  222. }
  223. if (<JobAppliedIndexSGStatusList>[] is M) {
  224. return data.map<JobAppliedIndexSGStatusList>((Map<String, dynamic> e) => JobAppliedIndexSGStatusList.fromJson(e)).toList() as M;
  225. }
  226. if (<JobAppliedListSGEntity>[] is M) {
  227. return data.map<JobAppliedListSGEntity>((Map<String, dynamic> e) => JobAppliedListSGEntity.fromJson(e)).toList() as M;
  228. }
  229. if (<JobAppliedListSGRows>[] is M) {
  230. return data.map<JobAppliedListSGRows>((Map<String, dynamic> e) => JobAppliedListSGRows.fromJson(e)).toList() as M;
  231. }
  232. if (<JobAppliedListSGRowsCheck>[] is M) {
  233. return data.map<JobAppliedListSGRowsCheck>((Map<String, dynamic> e) => JobAppliedListSGRowsCheck.fromJson(e)).toList() as M;
  234. }
  235. if (<JobAppliedListSGRowsStatusList>[] is M) {
  236. return data.map<JobAppliedListSGRowsStatusList>((Map<String, dynamic> e) => JobAppliedListSGRowsStatusList.fromJson(e)).toList() as M;
  237. }
  238. if (<JobAppliedRemarkViewSGEntity>[] is M) {
  239. return data.map<JobAppliedRemarkViewSGEntity>((Map<String, dynamic> e) => JobAppliedRemarkViewSGEntity.fromJson(e)).toList() as M;
  240. }
  241. if (<JobAppliedStaffSGEntity>[] is M) {
  242. return data.map<JobAppliedStaffSGEntity>((Map<String, dynamic> e) => JobAppliedStaffSGEntity.fromJson(e)).toList() as M;
  243. }
  244. if (<JobAppliedStaffSGRows>[] is M) {
  245. return data.map<JobAppliedStaffSGRows>((Map<String, dynamic> e) => JobAppliedStaffSGRows.fromJson(e)).toList() as M;
  246. }
  247. if (<JobListAddStaffEntity>[] is M) {
  248. return data.map<JobListAddStaffEntity>((Map<String, dynamic> e) => JobListAddStaffEntity.fromJson(e)).toList() as M;
  249. }
  250. if (<JobListAddStaffResultList>[] is M) {
  251. return data.map<JobListAddStaffResultList>((Map<String, dynamic> e) => JobListAddStaffResultList.fromJson(e)).toList() as M;
  252. }
  253. if (<JobListAppliedEditEntity>[] is M) {
  254. return data.map<JobListAppliedEditEntity>((Map<String, dynamic> e) => JobListAppliedEditEntity.fromJson(e)).toList() as M;
  255. }
  256. if (<JobListAppliedEditReasonList>[] is M) {
  257. return data.map<JobListAppliedEditReasonList>((Map<String, dynamic> e) => JobListAppliedEditReasonList.fromJson(e)).toList() as M;
  258. }
  259. if (<JobListAppliedInfoEntity>[] is M) {
  260. return data.map<JobListAppliedInfoEntity>((Map<String, dynamic> e) => JobListAppliedInfoEntity.fromJson(e)).toList() as M;
  261. }
  262. if (<JobListAppliedStaffListEntity>[] is M) {
  263. return data.map<JobListAppliedStaffListEntity>((Map<String, dynamic> e) => JobListAppliedStaffListEntity.fromJson(e)).toList() as M;
  264. }
  265. if (<JobListAppliedStaffListRows>[] is M) {
  266. return data.map<JobListAppliedStaffListRows>((Map<String, dynamic> e) => JobListAppliedStaffListRows.fromJson(e)).toList() as M;
  267. }
  268. if (<JobListAppliedStaffListRowsSecurityIn>[] is M) {
  269. return data.map<JobListAppliedStaffListRowsSecurityIn>((Map<String, dynamic> e) => JobListAppliedStaffListRowsSecurityIn.fromJson(e)).toList() as M;
  270. }
  271. if (<JobListAppliedStaffListRowsSecurityOut>[] is M) {
  272. return data.map<JobListAppliedStaffListRowsSecurityOut>((Map<String, dynamic> e) => JobListAppliedStaffListRowsSecurityOut.fromJson(e)).toList() as M;
  273. }
  274. if (<JobListAppliedStaffListRowsWorkIn>[] is M) {
  275. return data.map<JobListAppliedStaffListRowsWorkIn>((Map<String, dynamic> e) => JobListAppliedStaffListRowsWorkIn.fromJson(e)).toList() as M;
  276. }
  277. if (<JobListAppliedStaffListRowsWorkOut>[] is M) {
  278. return data.map<JobListAppliedStaffListRowsWorkOut>((Map<String, dynamic> e) => JobListAppliedStaffListRowsWorkOut.fromJson(e)).toList() as M;
  279. }
  280. if (<JobListAppliedStaffSearchEntity>[] is M) {
  281. return data.map<JobListAppliedStaffSearchEntity>((Map<String, dynamic> e) => JobListAppliedStaffSearchEntity.fromJson(e)).toList() as M;
  282. }
  283. if (<JobListAppliedStaffSearchRows>[] is M) {
  284. return data.map<JobListAppliedStaffSearchRows>((Map<String, dynamic> e) => JobListAppliedStaffSearchRows.fromJson(e)).toList() as M;
  285. }
  286. if (<JobListAppliedWorkFlowEntity>[] is M) {
  287. return data.map<JobListAppliedWorkFlowEntity>((Map<String, dynamic> e) => JobListAppliedWorkFlowEntity.fromJson(e)).toList() as M;
  288. }
  289. if (<JobListAppliedWorkFlowRecords>[] is M) {
  290. return data.map<JobListAppliedWorkFlowRecords>((Map<String, dynamic> e) => JobListAppliedWorkFlowRecords.fromJson(e)).toList() as M;
  291. }
  292. if (<JobListDetailEntity>[] is M) {
  293. return data.map<JobListDetailEntity>((Map<String, dynamic> e) => JobListDetailEntity.fromJson(e)).toList() as M;
  294. }
  295. if (<JobListDetailDepartmentList>[] is M) {
  296. return data.map<JobListDetailDepartmentList>((Map<String, dynamic> e) => JobListDetailDepartmentList.fromJson(e)).toList() as M;
  297. }
  298. if (<JobListEditIndexSGEntity>[] is M) {
  299. return data.map<JobListEditIndexSGEntity>((Map<String, dynamic> e) => JobListEditIndexSGEntity.fromJson(e)).toList() as M;
  300. }
  301. if (<JobListEditIndexOption>[] is M) {
  302. return data.map<JobListEditIndexOption>((Map<String, dynamic> e) => JobListEditIndexOption.fromJson(e)).toList() as M;
  303. }
  304. if (<JobListEntity>[] is M) {
  305. return data.map<JobListEntity>((Map<String, dynamic> e) => JobListEntity.fromJson(e)).toList() as M;
  306. }
  307. if (<JobListRows>[] is M) {
  308. return data.map<JobListRows>((Map<String, dynamic> e) => JobListRows.fromJson(e)).toList() as M;
  309. }
  310. if (<JobListIndexEntity>[] is M) {
  311. return data.map<JobListIndexEntity>((Map<String, dynamic> e) => JobListIndexEntity.fromJson(e)).toList() as M;
  312. }
  313. if (<JobListIndexDepartmentList>[] is M) {
  314. return data.map<JobListIndexDepartmentList>((Map<String, dynamic> e) => JobListIndexDepartmentList.fromJson(e)).toList() as M;
  315. }
  316. if (<JobListIndexStatusList>[] is M) {
  317. return data.map<JobListIndexStatusList>((Map<String, dynamic> e) => JobListIndexStatusList.fromJson(e)).toList() as M;
  318. }
  319. if (<JobListIndexSGEntity>[] is M) {
  320. return data.map<JobListIndexSGEntity>((Map<String, dynamic> e) => JobListIndexSGEntity.fromJson(e)).toList() as M;
  321. }
  322. if (<JobListIndexSGOption>[] is M) {
  323. return data.map<JobListIndexSGOption>((Map<String, dynamic> e) => JobListIndexSGOption.fromJson(e)).toList() as M;
  324. }
  325. if (<JobListRemarkViewEntity>[] is M) {
  326. return data.map<JobListRemarkViewEntity>((Map<String, dynamic> e) => JobListRemarkViewEntity.fromJson(e)).toList() as M;
  327. }
  328. if (<JobListSGEntity>[] is M) {
  329. return data.map<JobListSGEntity>((Map<String, dynamic> e) => JobListSGEntity.fromJson(e)).toList() as M;
  330. }
  331. if (<JobListSGRows>[] is M) {
  332. return data.map<JobListSGRows>((Map<String, dynamic> e) => JobListSGRows.fromJson(e)).toList() as M;
  333. }
  334. if (<JobTemplateEditIndexEntity>[] is M) {
  335. return data.map<JobTemplateEditIndexEntity>((Map<String, dynamic> e) => JobTemplateEditIndexEntity.fromJson(e)).toList() as M;
  336. }
  337. if (<JobTemplateEditIndexAgeList>[] is M) {
  338. return data.map<JobTemplateEditIndexAgeList>((Map<String, dynamic> e) => JobTemplateEditIndexAgeList.fromJson(e)).toList() as M;
  339. }
  340. if (<JobTemplateEditIndexSexList>[] is M) {
  341. return data.map<JobTemplateEditIndexSexList>((Map<String, dynamic> e) => JobTemplateEditIndexSexList.fromJson(e)).toList() as M;
  342. }
  343. if (<JobTemplateEditIndexLanguageList>[] is M) {
  344. return data.map<JobTemplateEditIndexLanguageList>((Map<String, dynamic> e) => JobTemplateEditIndexLanguageList.fromJson(e)).toList() as M;
  345. }
  346. if (<JobTemplateSGEntity>[] is M) {
  347. return data.map<JobTemplateSGEntity>((Map<String, dynamic> e) => JobTemplateSGEntity.fromJson(e)).toList() as M;
  348. }
  349. if (<JobTemplateSGRows>[] is M) {
  350. return data.map<JobTemplateSGRows>((Map<String, dynamic> e) => JobTemplateSGRows.fromJson(e)).toList() as M;
  351. }
  352. if (<JobTitleEditIndexEntity>[] is M) {
  353. return data.map<JobTitleEditIndexEntity>((Map<String, dynamic> e) => JobTitleEditIndexEntity.fromJson(e)).toList() as M;
  354. }
  355. if (<JobTitleEditIndexTemplate>[] is M) {
  356. return data.map<JobTitleEditIndexTemplate>((Map<String, dynamic> e) => JobTitleEditIndexTemplate.fromJson(e)).toList() as M;
  357. }
  358. if (<JobTitleSGEntity>[] is M) {
  359. return data.map<JobTitleSGEntity>((Map<String, dynamic> e) => JobTitleSGEntity.fromJson(e)).toList() as M;
  360. }
  361. if (<JobTitleSGRows>[] is M) {
  362. return data.map<JobTitleSGRows>((Map<String, dynamic> e) => JobTitleSGRows.fromJson(e)).toList() as M;
  363. }
  364. if (<LabourReportEntity>[] is M) {
  365. return data.map<LabourReportEntity>((Map<String, dynamic> e) => LabourReportEntity.fromJson(e)).toList() as M;
  366. }
  367. if (<LabourReportRows>[] is M) {
  368. return data.map<LabourReportRows>((Map<String, dynamic> e) => LabourReportRows.fromJson(e)).toList() as M;
  369. }
  370. if (<LabourReportTotal>[] is M) {
  371. return data.map<LabourReportTotal>((Map<String, dynamic> e) => LabourReportTotal.fromJson(e)).toList() as M;
  372. }
  373. if (<LabourReportVNEntity>[] is M) {
  374. return data.map<LabourReportVNEntity>((Map<String, dynamic> e) => LabourReportVNEntity.fromJson(e)).toList() as M;
  375. }
  376. if (<LabourReportVNRows>[] is M) {
  377. return data.map<LabourReportVNRows>((Map<String, dynamic> e) => LabourReportVNRows.fromJson(e)).toList() as M;
  378. }
  379. if (<LabourReportVNTotal>[] is M) {
  380. return data.map<LabourReportVNTotal>((Map<String, dynamic> e) => LabourReportVNTotal.fromJson(e)).toList() as M;
  381. }
  382. if (<LabourRequestEditIndexEntity>[] is M) {
  383. return data.map<LabourRequestEditIndexEntity>((Map<String, dynamic> e) => LabourRequestEditIndexEntity.fromJson(e)).toList() as M;
  384. }
  385. if (<LabourRequestEditIndexTemplateList>[] is M) {
  386. return data.map<LabourRequestEditIndexTemplateList>((Map<String, dynamic> e) => LabourRequestEditIndexTemplateList.fromJson(e)).toList() as M;
  387. }
  388. if (<LabourRequestEditIndexDepartmentList>[] is M) {
  389. return data.map<LabourRequestEditIndexDepartmentList>((Map<String, dynamic> e) => LabourRequestEditIndexDepartmentList.fromJson(e)).toList() as M;
  390. }
  391. if (<LabourRequestIndexEntity>[] is M) {
  392. return data.map<LabourRequestIndexEntity>((Map<String, dynamic> e) => LabourRequestIndexEntity.fromJson(e)).toList() as M;
  393. }
  394. if (<LabourRequestIndexDepartmentList>[] is M) {
  395. return data.map<LabourRequestIndexDepartmentList>((Map<String, dynamic> e) => LabourRequestIndexDepartmentList.fromJson(e)).toList() as M;
  396. }
  397. if (<LabourRequestIndexStatusList>[] is M) {
  398. return data.map<LabourRequestIndexStatusList>((Map<String, dynamic> e) => LabourRequestIndexStatusList.fromJson(e)).toList() as M;
  399. }
  400. if (<LabourRequestListEntity>[] is M) {
  401. return data.map<LabourRequestListEntity>((Map<String, dynamic> e) => LabourRequestListEntity.fromJson(e)).toList() as M;
  402. }
  403. if (<LabourRequestListRows>[] is M) {
  404. return data.map<LabourRequestListRows>((Map<String, dynamic> e) => LabourRequestListRows.fromJson(e)).toList() as M;
  405. }
  406. if (<LabourRequestSGAddIndexEntity>[] is M) {
  407. return data.map<LabourRequestSGAddIndexEntity>((Map<String, dynamic> e) => LabourRequestSGAddIndexEntity.fromJson(e)).toList() as M;
  408. }
  409. if (<LabourRequestSGAddIndexOption>[] is M) {
  410. return data.map<LabourRequestSGAddIndexOption>((Map<String, dynamic> e) => LabourRequestSGAddIndexOption.fromJson(e)).toList() as M;
  411. }
  412. if (<LabourRequestSGEntity>[] is M) {
  413. return data.map<LabourRequestSGEntity>((Map<String, dynamic> e) => LabourRequestSGEntity.fromJson(e)).toList() as M;
  414. }
  415. if (<LabourRequestSGCountList>[] is M) {
  416. return data.map<LabourRequestSGCountList>((Map<String, dynamic> e) => LabourRequestSGCountList.fromJson(e)).toList() as M;
  417. }
  418. if (<LabourRequestWorkFlowEntity>[] is M) {
  419. return data.map<LabourRequestWorkFlowEntity>((Map<String, dynamic> e) => LabourRequestWorkFlowEntity.fromJson(e)).toList() as M;
  420. }
  421. if (<LabourRequestWorkFlowRecords>[] is M) {
  422. return data.map<LabourRequestWorkFlowRecords>((Map<String, dynamic> e) => LabourRequestWorkFlowRecords.fromJson(e)).toList() as M;
  423. }
  424. if (<ReviseIndexSGEntity>[] is M) {
  425. return data.map<ReviseIndexSGEntity>((Map<String, dynamic> e) => ReviseIndexSGEntity.fromJson(e)).toList() as M;
  426. }
  427. if (<ReviseIndexSGStatusList>[] is M) {
  428. return data.map<ReviseIndexSGStatusList>((Map<String, dynamic> e) => ReviseIndexSGStatusList.fromJson(e)).toList() as M;
  429. }
  430. if (<ReviseListSGEntity>[] is M) {
  431. return data.map<ReviseListSGEntity>((Map<String, dynamic> e) => ReviseListSGEntity.fromJson(e)).toList() as M;
  432. }
  433. if (<ReviseListSGRows>[] is M) {
  434. return data.map<ReviseListSGRows>((Map<String, dynamic> e) => ReviseListSGRows.fromJson(e)).toList() as M;
  435. }
  436. if (<ReviseLogSGEntity>[] is M) {
  437. return data.map<ReviseLogSGEntity>((Map<String, dynamic> e) => ReviseLogSGEntity.fromJson(e)).toList() as M;
  438. }
  439. if (<ReviseLogSGRecords>[] is M) {
  440. return data.map<ReviseLogSGRecords>((Map<String, dynamic> e) => ReviseLogSGRecords.fromJson(e)).toList() as M;
  441. }
  442. if (<ReviseLogSGRecordsContent>[] is M) {
  443. return data.map<ReviseLogSGRecordsContent>((Map<String, dynamic> e) => ReviseLogSGRecordsContent.fromJson(e)).toList() as M;
  444. }
  445. if (<ReviseLogSGRecordsOption>[] is M) {
  446. return data.map<ReviseLogSGRecordsOption>((Map<String, dynamic> e) => ReviseLogSGRecordsOption.fromJson(e)).toList() as M;
  447. }
  448. if (<StaffDetailEntity>[] is M) {
  449. return data.map<StaffDetailEntity>((Map<String, dynamic> e) => StaffDetailEntity.fromJson(e)).toList() as M;
  450. }
  451. if (<StaffDetailSGEntity>[] is M) {
  452. return data.map<StaffDetailSGEntity>((Map<String, dynamic> e) => StaffDetailSGEntity.fromJson(e)).toList() as M;
  453. }
  454. if (<StaffDetailSGReviews>[] is M) {
  455. return data.map<StaffDetailSGReviews>((Map<String, dynamic> e) => StaffDetailSGReviews.fromJson(e)).toList() as M;
  456. }
  457. if (<StaffDetailSGReviewsReviews>[] is M) {
  458. return data.map<StaffDetailSGReviewsReviews>((Map<String, dynamic> e) => StaffDetailSGReviewsReviews.fromJson(e)).toList() as M;
  459. }
  460. if (<StaffJobHistorySGEntity>[] is M) {
  461. return data.map<StaffJobHistorySGEntity>((Map<String, dynamic> e) => StaffJobHistorySGEntity.fromJson(e)).toList() as M;
  462. }
  463. if (<StaffJobHistorySGRows>[] is M) {
  464. return data.map<StaffJobHistorySGRows>((Map<String, dynamic> e) => StaffJobHistorySGRows.fromJson(e)).toList() as M;
  465. }
  466. if (<StaffLabourHistoryEntity>[] is M) {
  467. return data.map<StaffLabourHistoryEntity>((Map<String, dynamic> e) => StaffLabourHistoryEntity.fromJson(e)).toList() as M;
  468. }
  469. if (<StaffLabourHistoryRows>[] is M) {
  470. return data.map<StaffLabourHistoryRows>((Map<String, dynamic> e) => StaffLabourHistoryRows.fromJson(e)).toList() as M;
  471. }
  472. if (<StaffLabourHistoryRowsSecurityIn>[] is M) {
  473. return data.map<StaffLabourHistoryRowsSecurityIn>((Map<String, dynamic> e) => StaffLabourHistoryRowsSecurityIn.fromJson(e)).toList() as M;
  474. }
  475. if (<StaffLabourHistoryRowsSecurityOut>[] is M) {
  476. return data.map<StaffLabourHistoryRowsSecurityOut>((Map<String, dynamic> e) => StaffLabourHistoryRowsSecurityOut.fromJson(e)).toList() as M;
  477. }
  478. if (<StaffLabourHistoryRowsWorkIn>[] is M) {
  479. return data.map<StaffLabourHistoryRowsWorkIn>((Map<String, dynamic> e) => StaffLabourHistoryRowsWorkIn.fromJson(e)).toList() as M;
  480. }
  481. if (<StaffLabourHistoryRowsWorkOut>[] is M) {
  482. return data.map<StaffLabourHistoryRowsWorkOut>((Map<String, dynamic> e) => StaffLabourHistoryRowsWorkOut.fromJson(e)).toList() as M;
  483. }
  484. if (<StaffRemarkHistoryEntity>[] is M) {
  485. return data.map<StaffRemarkHistoryEntity>((Map<String, dynamic> e) => StaffRemarkHistoryEntity.fromJson(e)).toList() as M;
  486. }
  487. if (<StaffRemarkHistoryRows>[] is M) {
  488. return data.map<StaffRemarkHistoryRows>((Map<String, dynamic> e) => StaffRemarkHistoryRows.fromJson(e)).toList() as M;
  489. }
  490. if (<StaffReportVNEntity>[] is M) {
  491. return data.map<StaffReportVNEntity>((Map<String, dynamic> e) => StaffReportVNEntity.fromJson(e)).toList() as M;
  492. }
  493. if (<StaffRequestReportEntity>[] is M) {
  494. return data.map<StaffRequestReportEntity>((Map<String, dynamic> e) => StaffRequestReportEntity.fromJson(e)).toList() as M;
  495. }
  496. if (<StaffReviewHistorySGEntity>[] is M) {
  497. return data.map<StaffReviewHistorySGEntity>((Map<String, dynamic> e) => StaffReviewHistorySGEntity.fromJson(e)).toList() as M;
  498. }
  499. if (<StaffReviewHistorySGReviews>[] is M) {
  500. return data.map<StaffReviewHistorySGReviews>((Map<String, dynamic> e) => StaffReviewHistorySGReviews.fromJson(e)).toList() as M;
  501. }
  502. if (<ServerTime>[] is M) {
  503. return data.map<ServerTime>((Map<String, dynamic> e) => ServerTime.fromJson(e)).toList() as M;
  504. }
  505. debugPrint("$M not found");
  506. return null;
  507. }
  508. static M? fromJsonAsT<M>(dynamic json) {
  509. if (json is M) {
  510. return json;
  511. }
  512. if (json is List) {
  513. return _getListChildType<M>(json.map((dynamic e) => e as Map<String, dynamic>).toList());
  514. } else {
  515. return jsonConvert.convert<M>(json);
  516. }
  517. }
  518. }
  519. class JsonConvertClassCollection {
  520. Map<String, JsonConvertFunction> convertFuncMap = {
  521. (AddEditReviseViewSGEntity).toString(): AddEditReviseViewSGEntity.fromJson,
  522. (AttendanceEntity).toString(): AttendanceEntity.fromJson,
  523. (AttendanceList).toString(): AttendanceList.fromJson,
  524. (CheckSuccessEntity).toString(): CheckSuccessEntity.fromJson,
  525. (DeviceListEntity).toString(): DeviceListEntity.fromJson,
  526. (DeviceListRows).toString(): DeviceListRows.fromJson,
  527. (FianceReportEntity).toString(): FianceReportEntity.fromJson,
  528. (FianceReportRateList).toString(): FianceReportRateList.fromJson,
  529. (HotelInfoEntity).toString(): HotelInfoEntity.fromJson,
  530. (HotelInfoMenus).toString(): HotelInfoMenus.fromJson,
  531. (HotelInfoMenusChildren).toString(): HotelInfoMenusChildren.fromJson,
  532. (IdNameEntity).toString(): IdNameEntity.fromJson,
  533. (JobAppliedEditIndexSGEntity).toString(): JobAppliedEditIndexSGEntity.fromJson,
  534. (JobAppliedEditIndexSGStatusList).toString(): JobAppliedEditIndexSGStatusList.fromJson,
  535. (JobAppliedIndexSGEntity).toString(): JobAppliedIndexSGEntity.fromJson,
  536. (JobAppliedIndexSGStatusList).toString(): JobAppliedIndexSGStatusList.fromJson,
  537. (JobAppliedListSGEntity).toString(): JobAppliedListSGEntity.fromJson,
  538. (JobAppliedListSGRows).toString(): JobAppliedListSGRows.fromJson,
  539. (JobAppliedListSGRowsCheck).toString(): JobAppliedListSGRowsCheck.fromJson,
  540. (JobAppliedListSGRowsStatusList).toString(): JobAppliedListSGRowsStatusList.fromJson,
  541. (JobAppliedRemarkViewSGEntity).toString(): JobAppliedRemarkViewSGEntity.fromJson,
  542. (JobAppliedStaffSGEntity).toString(): JobAppliedStaffSGEntity.fromJson,
  543. (JobAppliedStaffSGRows).toString(): JobAppliedStaffSGRows.fromJson,
  544. (JobListAddStaffEntity).toString(): JobListAddStaffEntity.fromJson,
  545. (JobListAddStaffResultList).toString(): JobListAddStaffResultList.fromJson,
  546. (JobListAppliedEditEntity).toString(): JobListAppliedEditEntity.fromJson,
  547. (JobListAppliedEditReasonList).toString(): JobListAppliedEditReasonList.fromJson,
  548. (JobListAppliedInfoEntity).toString(): JobListAppliedInfoEntity.fromJson,
  549. (JobListAppliedStaffListEntity).toString(): JobListAppliedStaffListEntity.fromJson,
  550. (JobListAppliedStaffListRows).toString(): JobListAppliedStaffListRows.fromJson,
  551. (JobListAppliedStaffListRowsSecurityIn).toString(): JobListAppliedStaffListRowsSecurityIn.fromJson,
  552. (JobListAppliedStaffListRowsSecurityOut).toString(): JobListAppliedStaffListRowsSecurityOut.fromJson,
  553. (JobListAppliedStaffListRowsWorkIn).toString(): JobListAppliedStaffListRowsWorkIn.fromJson,
  554. (JobListAppliedStaffListRowsWorkOut).toString(): JobListAppliedStaffListRowsWorkOut.fromJson,
  555. (JobListAppliedStaffSearchEntity).toString(): JobListAppliedStaffSearchEntity.fromJson,
  556. (JobListAppliedStaffSearchRows).toString(): JobListAppliedStaffSearchRows.fromJson,
  557. (JobListAppliedWorkFlowEntity).toString(): JobListAppliedWorkFlowEntity.fromJson,
  558. (JobListAppliedWorkFlowRecords).toString(): JobListAppliedWorkFlowRecords.fromJson,
  559. (JobListDetailEntity).toString(): JobListDetailEntity.fromJson,
  560. (JobListDetailDepartmentList).toString(): JobListDetailDepartmentList.fromJson,
  561. (JobListEditIndexSGEntity).toString(): JobListEditIndexSGEntity.fromJson,
  562. (JobListEditIndexOption).toString(): JobListEditIndexOption.fromJson,
  563. (JobListEntity).toString(): JobListEntity.fromJson,
  564. (JobListRows).toString(): JobListRows.fromJson,
  565. (JobListIndexEntity).toString(): JobListIndexEntity.fromJson,
  566. (JobListIndexDepartmentList).toString(): JobListIndexDepartmentList.fromJson,
  567. (JobListIndexStatusList).toString(): JobListIndexStatusList.fromJson,
  568. (JobListIndexSGEntity).toString(): JobListIndexSGEntity.fromJson,
  569. (JobListIndexSGOption).toString(): JobListIndexSGOption.fromJson,
  570. (JobListRemarkViewEntity).toString(): JobListRemarkViewEntity.fromJson,
  571. (JobListSGEntity).toString(): JobListSGEntity.fromJson,
  572. (JobListSGRows).toString(): JobListSGRows.fromJson,
  573. (JobTemplateEditIndexEntity).toString(): JobTemplateEditIndexEntity.fromJson,
  574. (JobTemplateEditIndexAgeList).toString(): JobTemplateEditIndexAgeList.fromJson,
  575. (JobTemplateEditIndexSexList).toString(): JobTemplateEditIndexSexList.fromJson,
  576. (JobTemplateEditIndexLanguageList).toString(): JobTemplateEditIndexLanguageList.fromJson,
  577. (JobTemplateSGEntity).toString(): JobTemplateSGEntity.fromJson,
  578. (JobTemplateSGRows).toString(): JobTemplateSGRows.fromJson,
  579. (JobTitleEditIndexEntity).toString(): JobTitleEditIndexEntity.fromJson,
  580. (JobTitleEditIndexTemplate).toString(): JobTitleEditIndexTemplate.fromJson,
  581. (JobTitleSGEntity).toString(): JobTitleSGEntity.fromJson,
  582. (JobTitleSGRows).toString(): JobTitleSGRows.fromJson,
  583. (LabourReportEntity).toString(): LabourReportEntity.fromJson,
  584. (LabourReportRows).toString(): LabourReportRows.fromJson,
  585. (LabourReportTotal).toString(): LabourReportTotal.fromJson,
  586. (LabourReportVNEntity).toString(): LabourReportVNEntity.fromJson,
  587. (LabourReportVNRows).toString(): LabourReportVNRows.fromJson,
  588. (LabourReportVNTotal).toString(): LabourReportVNTotal.fromJson,
  589. (LabourRequestEditIndexEntity).toString(): LabourRequestEditIndexEntity.fromJson,
  590. (LabourRequestEditIndexTemplateList).toString(): LabourRequestEditIndexTemplateList.fromJson,
  591. (LabourRequestEditIndexDepartmentList).toString(): LabourRequestEditIndexDepartmentList.fromJson,
  592. (LabourRequestIndexEntity).toString(): LabourRequestIndexEntity.fromJson,
  593. (LabourRequestIndexDepartmentList).toString(): LabourRequestIndexDepartmentList.fromJson,
  594. (LabourRequestIndexStatusList).toString(): LabourRequestIndexStatusList.fromJson,
  595. (LabourRequestListEntity).toString(): LabourRequestListEntity.fromJson,
  596. (LabourRequestListRows).toString(): LabourRequestListRows.fromJson,
  597. (LabourRequestSGAddIndexEntity).toString(): LabourRequestSGAddIndexEntity.fromJson,
  598. (LabourRequestSGAddIndexOption).toString(): LabourRequestSGAddIndexOption.fromJson,
  599. (LabourRequestSGEntity).toString(): LabourRequestSGEntity.fromJson,
  600. (LabourRequestSGCountList).toString(): LabourRequestSGCountList.fromJson,
  601. (LabourRequestWorkFlowEntity).toString(): LabourRequestWorkFlowEntity.fromJson,
  602. (LabourRequestWorkFlowRecords).toString(): LabourRequestWorkFlowRecords.fromJson,
  603. (ReviseIndexSGEntity).toString(): ReviseIndexSGEntity.fromJson,
  604. (ReviseIndexSGStatusList).toString(): ReviseIndexSGStatusList.fromJson,
  605. (ReviseListSGEntity).toString(): ReviseListSGEntity.fromJson,
  606. (ReviseListSGRows).toString(): ReviseListSGRows.fromJson,
  607. (ReviseLogSGEntity).toString(): ReviseLogSGEntity.fromJson,
  608. (ReviseLogSGRecords).toString(): ReviseLogSGRecords.fromJson,
  609. (ReviseLogSGRecordsContent).toString(): ReviseLogSGRecordsContent.fromJson,
  610. (ReviseLogSGRecordsOption).toString(): ReviseLogSGRecordsOption.fromJson,
  611. (StaffDetailEntity).toString(): StaffDetailEntity.fromJson,
  612. (StaffDetailSGEntity).toString(): StaffDetailSGEntity.fromJson,
  613. (StaffDetailSGReviews).toString(): StaffDetailSGReviews.fromJson,
  614. (StaffDetailSGReviewsReviews).toString(): StaffDetailSGReviewsReviews.fromJson,
  615. (StaffJobHistorySGEntity).toString(): StaffJobHistorySGEntity.fromJson,
  616. (StaffJobHistorySGRows).toString(): StaffJobHistorySGRows.fromJson,
  617. (StaffLabourHistoryEntity).toString(): StaffLabourHistoryEntity.fromJson,
  618. (StaffLabourHistoryRows).toString(): StaffLabourHistoryRows.fromJson,
  619. (StaffLabourHistoryRowsSecurityIn).toString(): StaffLabourHistoryRowsSecurityIn.fromJson,
  620. (StaffLabourHistoryRowsSecurityOut).toString(): StaffLabourHistoryRowsSecurityOut.fromJson,
  621. (StaffLabourHistoryRowsWorkIn).toString(): StaffLabourHistoryRowsWorkIn.fromJson,
  622. (StaffLabourHistoryRowsWorkOut).toString(): StaffLabourHistoryRowsWorkOut.fromJson,
  623. (StaffRemarkHistoryEntity).toString(): StaffRemarkHistoryEntity.fromJson,
  624. (StaffRemarkHistoryRows).toString(): StaffRemarkHistoryRows.fromJson,
  625. (StaffReportVNEntity).toString(): StaffReportVNEntity.fromJson,
  626. (StaffRequestReportEntity).toString(): StaffRequestReportEntity.fromJson,
  627. (StaffReviewHistorySGEntity).toString(): StaffReviewHistorySGEntity.fromJson,
  628. (StaffReviewHistorySGReviews).toString(): StaffReviewHistorySGReviews.fromJson,
  629. (ServerTime).toString(): ServerTime.fromJson,
  630. };
  631. bool containsKey(String type) {
  632. return convertFuncMap.containsKey(type);
  633. }
  634. JsonConvertFunction? operator [](String key) {
  635. return convertFuncMap[key];
  636. }
  637. }