device.m.dart 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  1. import 'aIDiagnosis.m.dart';
  2. import 'connect.m.dart';
  3. import 'authentication.m.dart';
  4. import 'package:fis_common/json_convert.dart';
  5. class UploadDeviceDTO extends BaseDTO{
  6. String? serialNumber;
  7. String? deviceModel;
  8. String? deviceType;
  9. String? deviceSoftwareVersion;
  10. String? sDKSoftwareVersion;
  11. UploadDeviceDTO({
  12. this.serialNumber,
  13. this.deviceModel,
  14. this.deviceType,
  15. this.deviceSoftwareVersion,
  16. this.sDKSoftwareVersion,
  17. DateTime? createTime,
  18. DateTime? updateTime,
  19. }) : super(
  20. createTime: createTime,
  21. updateTime: updateTime,
  22. );
  23. factory UploadDeviceDTO.fromJson(Map<String, dynamic> map) {
  24. return UploadDeviceDTO(
  25. serialNumber: map['SerialNumber'],
  26. deviceModel: map['DeviceModel'],
  27. deviceType: map['DeviceType'],
  28. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  29. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  30. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  31. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  32. );
  33. }
  34. Map<String, dynamic> toJson() {
  35. final map = super.toJson();
  36. if(serialNumber != null)
  37. map['SerialNumber'] = serialNumber;
  38. if(deviceModel != null)
  39. map['DeviceModel'] = deviceModel;
  40. if(deviceType != null)
  41. map['DeviceType'] = deviceType;
  42. if(deviceSoftwareVersion != null)
  43. map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
  44. if(sDKSoftwareVersion != null)
  45. map['SDKSoftwareVersion'] = sDKSoftwareVersion;
  46. return map;
  47. }
  48. }
  49. class CreateDeviceRequest extends UploadDeviceDTO{
  50. CreateDeviceRequest({
  51. String? serialNumber,
  52. String? deviceModel,
  53. String? deviceType,
  54. String? deviceSoftwareVersion,
  55. String? sDKSoftwareVersion,
  56. DateTime? createTime,
  57. DateTime? updateTime,
  58. }) : super(
  59. serialNumber: serialNumber,
  60. deviceModel: deviceModel,
  61. deviceType: deviceType,
  62. deviceSoftwareVersion: deviceSoftwareVersion,
  63. sDKSoftwareVersion: sDKSoftwareVersion,
  64. createTime: createTime,
  65. updateTime: updateTime,
  66. );
  67. factory CreateDeviceRequest.fromJson(Map<String, dynamic> map) {
  68. return CreateDeviceRequest(
  69. serialNumber: map['SerialNumber'],
  70. deviceModel: map['DeviceModel'],
  71. deviceType: map['DeviceType'],
  72. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  73. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  74. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  75. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  76. );
  77. }
  78. Map<String, dynamic> toJson() {
  79. final map = super.toJson();
  80. return map;
  81. }
  82. }
  83. class DeviceExtendInfoDTO extends DeviceInfoDTO{
  84. String? organizationName;
  85. String? departmentName;
  86. bool isOnline;
  87. String? organizationDirectorCode;
  88. String? organizationDirectorUserName;
  89. String? organizationDirectorFullName;
  90. String? deviceTypeName;
  91. DeviceExtendInfoDTO({
  92. this.organizationName,
  93. this.departmentName,
  94. this.isOnline = false,
  95. this.organizationDirectorCode,
  96. this.organizationDirectorUserName,
  97. this.organizationDirectorFullName,
  98. this.deviceTypeName,
  99. String? deviceCode,
  100. String? serialNumber,
  101. String? password,
  102. String? name,
  103. String? description,
  104. String? deviceModel,
  105. String? deviceType,
  106. String? headPicUrl,
  107. String? deviceSoftwareVersion,
  108. String? sDKSoftwareVersion,
  109. String? organizationCode,
  110. String? departmentCode,
  111. String? shortCode,
  112. bool isAutoShared = false,
  113. bool isEncryptedShow = false,
  114. DateTime? lastLoginTime,
  115. String? systemVersion,
  116. String? cPUModel,
  117. String? systemLanguage,
  118. List<String >? diagnosisModules,
  119. List<String >? reportPosterCodes,
  120. DateTime? createTime,
  121. DateTime? updateTime,
  122. }) : super(
  123. deviceCode: deviceCode,
  124. serialNumber: serialNumber,
  125. password: password,
  126. name: name,
  127. description: description,
  128. deviceModel: deviceModel,
  129. deviceType: deviceType,
  130. headPicUrl: headPicUrl,
  131. deviceSoftwareVersion: deviceSoftwareVersion,
  132. sDKSoftwareVersion: sDKSoftwareVersion,
  133. organizationCode: organizationCode,
  134. departmentCode: departmentCode,
  135. shortCode: shortCode,
  136. isAutoShared: isAutoShared,
  137. isEncryptedShow: isEncryptedShow,
  138. lastLoginTime: lastLoginTime,
  139. systemVersion: systemVersion,
  140. cPUModel: cPUModel,
  141. systemLanguage: systemLanguage,
  142. diagnosisModules: diagnosisModules,
  143. reportPosterCodes: reportPosterCodes,
  144. createTime: createTime,
  145. updateTime: updateTime,
  146. );
  147. factory DeviceExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  148. return DeviceExtendInfoDTO(
  149. organizationName: map['OrganizationName'],
  150. departmentName: map['DepartmentName'],
  151. isOnline: map['IsOnline'],
  152. organizationDirectorCode: map['OrganizationDirectorCode'],
  153. organizationDirectorUserName: map['OrganizationDirectorUserName'],
  154. organizationDirectorFullName: map['OrganizationDirectorFullName'],
  155. deviceTypeName: map['DeviceTypeName'],
  156. deviceCode: map['DeviceCode'],
  157. serialNumber: map['SerialNumber'],
  158. password: map['Password'],
  159. name: map['Name'],
  160. description: map['Description'],
  161. deviceModel: map['DeviceModel'],
  162. deviceType: map['DeviceType'],
  163. headPicUrl: map['HeadPicUrl'],
  164. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  165. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  166. organizationCode: map['OrganizationCode'],
  167. departmentCode: map['DepartmentCode'],
  168. shortCode: map['ShortCode'],
  169. isAutoShared: map['IsAutoShared'],
  170. isEncryptedShow: map['IsEncryptedShow'],
  171. lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
  172. systemVersion: map['SystemVersion'],
  173. cPUModel: map['CPUModel'],
  174. systemLanguage: map['SystemLanguage'],
  175. diagnosisModules: map['DiagnosisModules'] != null ? map['DiagnosisModules'].cast<String>().toList() : null,
  176. reportPosterCodes: map['ReportPosterCodes'] != null ? map['ReportPosterCodes'].cast<String>().toList() : null,
  177. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  178. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  179. );
  180. }
  181. Map<String, dynamic> toJson() {
  182. final map = super.toJson();
  183. if(organizationName != null)
  184. map['OrganizationName'] = organizationName;
  185. if(departmentName != null)
  186. map['DepartmentName'] = departmentName;
  187. map['IsOnline'] = isOnline;
  188. if(organizationDirectorCode != null)
  189. map['OrganizationDirectorCode'] = organizationDirectorCode;
  190. if(organizationDirectorUserName != null)
  191. map['OrganizationDirectorUserName'] = organizationDirectorUserName;
  192. if(organizationDirectorFullName != null)
  193. map['OrganizationDirectorFullName'] = organizationDirectorFullName;
  194. if(deviceTypeName != null)
  195. map['DeviceTypeName'] = deviceTypeName;
  196. return map;
  197. }
  198. }
  199. class GetDeviceRequest extends TokenRequest{
  200. String? deviceCode;
  201. GetDeviceRequest({
  202. this.deviceCode,
  203. String? token,
  204. }) : super(
  205. token: token,
  206. );
  207. factory GetDeviceRequest.fromJson(Map<String, dynamic> map) {
  208. return GetDeviceRequest(
  209. deviceCode: map['DeviceCode'],
  210. token: map['Token'],
  211. );
  212. }
  213. Map<String, dynamic> toJson() {
  214. final map = super.toJson();
  215. if(deviceCode != null)
  216. map['DeviceCode'] = deviceCode;
  217. return map;
  218. }
  219. }
  220. class GetDeviceByShortCodeRequest extends TokenRequest{
  221. String? shortCode;
  222. GetDeviceByShortCodeRequest({
  223. this.shortCode,
  224. String? token,
  225. }) : super(
  226. token: token,
  227. );
  228. factory GetDeviceByShortCodeRequest.fromJson(Map<String, dynamic> map) {
  229. return GetDeviceByShortCodeRequest(
  230. shortCode: map['ShortCode'],
  231. token: map['Token'],
  232. );
  233. }
  234. Map<String, dynamic> toJson() {
  235. final map = super.toJson();
  236. if(shortCode != null)
  237. map['ShortCode'] = shortCode;
  238. return map;
  239. }
  240. }
  241. class PageCollection<T> {
  242. int currentPage;
  243. int pageSize;
  244. int dataCount;
  245. List<T>? pageData;
  246. PageCollection({
  247. this.currentPage = 0,
  248. this.pageSize = 0,
  249. this.dataCount = 0,
  250. this.pageData,
  251. });
  252. factory PageCollection.fromJson(Map<String, dynamic> map) {
  253. List<T> pageDataList = [];
  254. if (map['PageData'] != null) {
  255. pageDataList.addAll(
  256. (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
  257. }
  258. return PageCollection(
  259. currentPage: map['CurrentPage'],
  260. pageSize: map['PageSize'],
  261. dataCount: map['DataCount'],
  262. pageData: pageDataList,
  263. );
  264. }
  265. Map<String, dynamic> toJson() {
  266. final map = Map<String, dynamic>();
  267. map['CurrentPage'] = currentPage;
  268. map['PageSize'] = pageSize;
  269. map['DataCount'] = dataCount;
  270. if(pageData != null)
  271. map['PageData'] = pageData;
  272. return map;
  273. }
  274. }
  275. class PageFilterRequest extends BaseRequest{
  276. int currentPage;
  277. int pageSize;
  278. Map<String,String>? filter;
  279. bool isFuzzy;
  280. PageFilterRequest({
  281. this.currentPage = 0,
  282. this.pageSize = 0,
  283. this.filter,
  284. this.isFuzzy = false,
  285. }) : super(
  286. );
  287. factory PageFilterRequest.fromJson(Map<String, dynamic> map) {
  288. return PageFilterRequest(
  289. currentPage: map['CurrentPage'],
  290. pageSize: map['PageSize'],
  291. filter: map['Filter'] != null ? map['Filter'].cast<String,String>() : null,
  292. isFuzzy: map['IsFuzzy'],
  293. );
  294. }
  295. Map<String, dynamic> toJson() {
  296. final map = super.toJson();
  297. map['CurrentPage'] = currentPage;
  298. map['PageSize'] = pageSize;
  299. if(filter != null)
  300. map['Filter'] = filter;
  301. map['IsFuzzy'] = isFuzzy;
  302. return map;
  303. }
  304. }
  305. class BindDeviceRequest extends TokenRequest{
  306. String? serialNumber;
  307. String? name;
  308. String? description;
  309. String? headPicUrl;
  310. String? organizationCode;
  311. String? departmentCode;
  312. String? shortCode;
  313. bool isAutoShared;
  314. BindDeviceRequest({
  315. this.serialNumber,
  316. this.name,
  317. this.description,
  318. this.headPicUrl,
  319. this.organizationCode,
  320. this.departmentCode,
  321. this.shortCode,
  322. this.isAutoShared = false,
  323. String? token,
  324. }) : super(
  325. token: token,
  326. );
  327. factory BindDeviceRequest.fromJson(Map<String, dynamic> map) {
  328. return BindDeviceRequest(
  329. serialNumber: map['SerialNumber'],
  330. name: map['Name'],
  331. description: map['Description'],
  332. headPicUrl: map['HeadPicUrl'],
  333. organizationCode: map['OrganizationCode'],
  334. departmentCode: map['DepartmentCode'],
  335. shortCode: map['ShortCode'],
  336. isAutoShared: map['IsAutoShared'],
  337. token: map['Token'],
  338. );
  339. }
  340. Map<String, dynamic> toJson() {
  341. final map = super.toJson();
  342. if(serialNumber != null)
  343. map['SerialNumber'] = serialNumber;
  344. if(name != null)
  345. map['Name'] = name;
  346. if(description != null)
  347. map['Description'] = description;
  348. if(headPicUrl != null)
  349. map['HeadPicUrl'] = headPicUrl;
  350. if(organizationCode != null)
  351. map['OrganizationCode'] = organizationCode;
  352. if(departmentCode != null)
  353. map['DepartmentCode'] = departmentCode;
  354. if(shortCode != null)
  355. map['ShortCode'] = shortCode;
  356. map['IsAutoShared'] = isAutoShared;
  357. return map;
  358. }
  359. }
  360. class ModifyDeviceRequest extends TokenRequest{
  361. String? deviceCode;
  362. String? name;
  363. String? headPicUrl;
  364. String? departmentCode;
  365. bool isAutoShared;
  366. ModifyDeviceRequest({
  367. this.deviceCode,
  368. this.name,
  369. this.headPicUrl,
  370. this.departmentCode,
  371. this.isAutoShared = false,
  372. String? token,
  373. }) : super(
  374. token: token,
  375. );
  376. factory ModifyDeviceRequest.fromJson(Map<String, dynamic> map) {
  377. return ModifyDeviceRequest(
  378. deviceCode: map['DeviceCode'],
  379. name: map['Name'],
  380. headPicUrl: map['HeadPicUrl'],
  381. departmentCode: map['DepartmentCode'],
  382. isAutoShared: map['IsAutoShared'],
  383. token: map['Token'],
  384. );
  385. }
  386. Map<String, dynamic> toJson() {
  387. final map = super.toJson();
  388. if(deviceCode != null)
  389. map['DeviceCode'] = deviceCode;
  390. if(name != null)
  391. map['Name'] = name;
  392. if(headPicUrl != null)
  393. map['HeadPicUrl'] = headPicUrl;
  394. if(departmentCode != null)
  395. map['DepartmentCode'] = departmentCode;
  396. map['IsAutoShared'] = isAutoShared;
  397. return map;
  398. }
  399. }
  400. enum DictionaryTypeEnum {
  401. DeviceModel,
  402. DeviceType,
  403. }
  404. class CreateDictionaryItemRequest extends TokenRequest{
  405. DictionaryTypeEnum dictionaryType;
  406. String? dictionaryItemValue;
  407. String? parentCode;
  408. CreateDictionaryItemRequest({
  409. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  410. this.dictionaryItemValue,
  411. this.parentCode,
  412. String? token,
  413. }) : super(
  414. token: token,
  415. );
  416. factory CreateDictionaryItemRequest.fromJson(Map<String, dynamic> map) {
  417. return CreateDictionaryItemRequest(
  418. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  419. dictionaryItemValue: map['DictionaryItemValue'],
  420. parentCode: map['ParentCode'],
  421. token: map['Token'],
  422. );
  423. }
  424. Map<String, dynamic> toJson() {
  425. final map = super.toJson();
  426. map['DictionaryType'] = dictionaryType.index;
  427. if(dictionaryItemValue != null)
  428. map['DictionaryItemValue'] = dictionaryItemValue;
  429. if(parentCode != null)
  430. map['ParentCode'] = parentCode;
  431. return map;
  432. }
  433. }
  434. class DictionaryDTO extends BaseDTO{
  435. String? dictionaryCode;
  436. DictionaryTypeEnum dictionaryType;
  437. String? value;
  438. String? parentCode;
  439. DictionaryDTO({
  440. this.dictionaryCode,
  441. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  442. this.value,
  443. this.parentCode,
  444. DateTime? createTime,
  445. DateTime? updateTime,
  446. }) : super(
  447. createTime: createTime,
  448. updateTime: updateTime,
  449. );
  450. factory DictionaryDTO.fromJson(Map<String, dynamic> map) {
  451. return DictionaryDTO(
  452. dictionaryCode: map['DictionaryCode'],
  453. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  454. value: map['Value'],
  455. parentCode: map['ParentCode'],
  456. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  457. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  458. );
  459. }
  460. Map<String, dynamic> toJson() {
  461. final map = super.toJson();
  462. if(dictionaryCode != null)
  463. map['DictionaryCode'] = dictionaryCode;
  464. map['DictionaryType'] = dictionaryType.index;
  465. if(value != null)
  466. map['Value'] = value;
  467. if(parentCode != null)
  468. map['ParentCode'] = parentCode;
  469. return map;
  470. }
  471. }
  472. class FindDeviceModelItemsRequest extends TokenRequest{
  473. DictionaryTypeEnum dictionaryType;
  474. String? deviceTypeCode;
  475. FindDeviceModelItemsRequest({
  476. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  477. this.deviceTypeCode,
  478. String? token,
  479. }) : super(
  480. token: token,
  481. );
  482. factory FindDeviceModelItemsRequest.fromJson(Map<String, dynamic> map) {
  483. return FindDeviceModelItemsRequest(
  484. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  485. deviceTypeCode: map['DeviceTypeCode'],
  486. token: map['Token'],
  487. );
  488. }
  489. Map<String, dynamic> toJson() {
  490. final map = super.toJson();
  491. map['DictionaryType'] = dictionaryType.index;
  492. if(deviceTypeCode != null)
  493. map['DeviceTypeCode'] = deviceTypeCode;
  494. return map;
  495. }
  496. }
  497. class FindDeviceTypeItemsRequest extends TokenRequest{
  498. DictionaryTypeEnum dictionaryType;
  499. FindDeviceTypeItemsRequest({
  500. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  501. String? token,
  502. }) : super(
  503. token: token,
  504. );
  505. factory FindDeviceTypeItemsRequest.fromJson(Map<String, dynamic> map) {
  506. return FindDeviceTypeItemsRequest(
  507. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  508. token: map['Token'],
  509. );
  510. }
  511. Map<String, dynamic> toJson() {
  512. final map = super.toJson();
  513. map['DictionaryType'] = dictionaryType.index;
  514. return map;
  515. }
  516. }
  517. class CreateShareDeviceToUserRequest extends TokenRequest{
  518. List<String >? userCodes;
  519. String? deviceCode;
  520. CreateShareDeviceToUserRequest({
  521. this.userCodes,
  522. this.deviceCode,
  523. String? token,
  524. }) : super(
  525. token: token,
  526. );
  527. factory CreateShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  528. return CreateShareDeviceToUserRequest(
  529. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  530. deviceCode: map['DeviceCode'],
  531. token: map['Token'],
  532. );
  533. }
  534. Map<String, dynamic> toJson() {
  535. final map = super.toJson();
  536. if(userCodes != null)
  537. map['UserCodes'] = userCodes;
  538. if(deviceCode != null)
  539. map['DeviceCode'] = deviceCode;
  540. return map;
  541. }
  542. }
  543. class DeleteShareDeviceToUserRequest extends TokenRequest{
  544. List<String >? userCodes;
  545. String? deviceCode;
  546. DeleteShareDeviceToUserRequest({
  547. this.userCodes,
  548. this.deviceCode,
  549. String? token,
  550. }) : super(
  551. token: token,
  552. );
  553. factory DeleteShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  554. return DeleteShareDeviceToUserRequest(
  555. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  556. deviceCode: map['DeviceCode'],
  557. token: map['Token'],
  558. );
  559. }
  560. Map<String, dynamic> toJson() {
  561. final map = super.toJson();
  562. if(userCodes != null)
  563. map['UserCodes'] = userCodes;
  564. if(deviceCode != null)
  565. map['DeviceCode'] = deviceCode;
  566. return map;
  567. }
  568. }
  569. class RemoveDeviceRelevancyRequest extends TokenRequest{
  570. String? organizationCode;
  571. String? departmentCode;
  572. String? deviceCode;
  573. RemoveDeviceRelevancyRequest({
  574. this.organizationCode,
  575. this.departmentCode,
  576. this.deviceCode,
  577. String? token,
  578. }) : super(
  579. token: token,
  580. );
  581. factory RemoveDeviceRelevancyRequest.fromJson(Map<String, dynamic> map) {
  582. return RemoveDeviceRelevancyRequest(
  583. organizationCode: map['OrganizationCode'],
  584. departmentCode: map['DepartmentCode'],
  585. deviceCode: map['DeviceCode'],
  586. token: map['Token'],
  587. );
  588. }
  589. Map<String, dynamic> toJson() {
  590. final map = super.toJson();
  591. if(organizationCode != null)
  592. map['OrganizationCode'] = organizationCode;
  593. if(departmentCode != null)
  594. map['DepartmentCode'] = departmentCode;
  595. if(deviceCode != null)
  596. map['DeviceCode'] = deviceCode;
  597. return map;
  598. }
  599. }
  600. class GetPersonDeviceRequest extends PageRequest{
  601. String? keyWord;
  602. String? deviceType;
  603. String? deviceModel;
  604. bool? isOnline;
  605. GetPersonDeviceRequest({
  606. this.keyWord,
  607. this.deviceType,
  608. this.deviceModel,
  609. this.isOnline,
  610. int pageIndex = 0,
  611. int pageSize = 0,
  612. String? token,
  613. }) : super(
  614. pageIndex: pageIndex,
  615. pageSize: pageSize,
  616. token: token,
  617. );
  618. factory GetPersonDeviceRequest.fromJson(Map<String, dynamic> map) {
  619. return GetPersonDeviceRequest(
  620. keyWord: map['KeyWord'],
  621. deviceType: map['DeviceType'],
  622. deviceModel: map['DeviceModel'],
  623. isOnline: map['IsOnline'],
  624. pageIndex: map['PageIndex'],
  625. pageSize: map['PageSize'],
  626. token: map['Token'],
  627. );
  628. }
  629. Map<String, dynamic> toJson() {
  630. final map = super.toJson();
  631. if(keyWord != null)
  632. map['KeyWord'] = keyWord;
  633. if(deviceType != null)
  634. map['DeviceType'] = deviceType;
  635. if(deviceModel != null)
  636. map['DeviceModel'] = deviceModel;
  637. if(isOnline != null)
  638. map['IsOnline'] = isOnline;
  639. return map;
  640. }
  641. }
  642. class FindDevicesByOrganizationCodeRequest extends TokenRequest{
  643. String? organizationCode;
  644. FindDevicesByOrganizationCodeRequest({
  645. this.organizationCode,
  646. String? token,
  647. }) : super(
  648. token: token,
  649. );
  650. factory FindDevicesByOrganizationCodeRequest.fromJson(Map<String, dynamic> map) {
  651. return FindDevicesByOrganizationCodeRequest(
  652. organizationCode: map['OrganizationCode'],
  653. token: map['Token'],
  654. );
  655. }
  656. Map<String, dynamic> toJson() {
  657. final map = super.toJson();
  658. if(organizationCode != null)
  659. map['OrganizationCode'] = organizationCode;
  660. return map;
  661. }
  662. }
  663. class SelectItemDTO {
  664. String? key;
  665. String? value;
  666. SelectItemDTO({
  667. this.key,
  668. this.value,
  669. });
  670. factory SelectItemDTO.fromJson(Map<String, dynamic> map) {
  671. return SelectItemDTO(
  672. key: map['Key'],
  673. value: map['Value'],
  674. );
  675. }
  676. Map<String, dynamic> toJson() {
  677. final map = Map<String, dynamic>();
  678. if(key != null)
  679. map['Key'] = key;
  680. if(value != null)
  681. map['Value'] = value;
  682. return map;
  683. }
  684. }
  685. class AddDeviceToOrgRequest extends TokenRequest{
  686. String? uniqueCode;
  687. AddDeviceToOrgRequest({
  688. this.uniqueCode,
  689. String? token,
  690. }) : super(
  691. token: token,
  692. );
  693. factory AddDeviceToOrgRequest.fromJson(Map<String, dynamic> map) {
  694. return AddDeviceToOrgRequest(
  695. uniqueCode: map['UniqueCode'],
  696. token: map['Token'],
  697. );
  698. }
  699. Map<String, dynamic> toJson() {
  700. final map = super.toJson();
  701. if(uniqueCode != null)
  702. map['UniqueCode'] = uniqueCode;
  703. return map;
  704. }
  705. }
  706. class DiagnosisModuleDTO extends BaseDTO{
  707. String? diagnosisModuleCode;
  708. String? diagnosisModule;
  709. bool enabled;
  710. DiagnosisModuleDTO({
  711. this.diagnosisModuleCode,
  712. this.diagnosisModule,
  713. this.enabled = false,
  714. DateTime? createTime,
  715. DateTime? updateTime,
  716. }) : super(
  717. createTime: createTime,
  718. updateTime: updateTime,
  719. );
  720. factory DiagnosisModuleDTO.fromJson(Map<String, dynamic> map) {
  721. return DiagnosisModuleDTO(
  722. diagnosisModuleCode: map['DiagnosisModuleCode'],
  723. diagnosisModule: map['DiagnosisModule'],
  724. enabled: map['Enabled'],
  725. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  726. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  727. );
  728. }
  729. Map<String, dynamic> toJson() {
  730. final map = super.toJson();
  731. if(diagnosisModuleCode != null)
  732. map['DiagnosisModuleCode'] = diagnosisModuleCode;
  733. if(diagnosisModule != null)
  734. map['DiagnosisModule'] = diagnosisModule;
  735. map['Enabled'] = enabled;
  736. return map;
  737. }
  738. }
  739. class FindDeviceDiagnosisModulesRequest extends TokenRequest{
  740. String? deviceCode;
  741. FindDeviceDiagnosisModulesRequest({
  742. this.deviceCode,
  743. String? token,
  744. }) : super(
  745. token: token,
  746. );
  747. factory FindDeviceDiagnosisModulesRequest.fromJson(Map<String, dynamic> map) {
  748. return FindDeviceDiagnosisModulesRequest(
  749. deviceCode: map['DeviceCode'],
  750. token: map['Token'],
  751. );
  752. }
  753. Map<String, dynamic> toJson() {
  754. final map = super.toJson();
  755. if(deviceCode != null)
  756. map['DeviceCode'] = deviceCode;
  757. return map;
  758. }
  759. }
  760. class ModifyDeviceDiagnosisModuleStateRequest extends TokenRequest{
  761. String? deviceCode;
  762. String? diagnosisModule;
  763. bool enabled;
  764. ModifyDeviceDiagnosisModuleStateRequest({
  765. this.deviceCode,
  766. this.diagnosisModule,
  767. this.enabled = false,
  768. String? token,
  769. }) : super(
  770. token: token,
  771. );
  772. factory ModifyDeviceDiagnosisModuleStateRequest.fromJson(Map<String, dynamic> map) {
  773. return ModifyDeviceDiagnosisModuleStateRequest(
  774. deviceCode: map['DeviceCode'],
  775. diagnosisModule: map['DiagnosisModule'],
  776. enabled: map['Enabled'],
  777. token: map['Token'],
  778. );
  779. }
  780. Map<String, dynamic> toJson() {
  781. final map = super.toJson();
  782. if(deviceCode != null)
  783. map['DeviceCode'] = deviceCode;
  784. if(diagnosisModule != null)
  785. map['DiagnosisModule'] = diagnosisModule;
  786. map['Enabled'] = enabled;
  787. return map;
  788. }
  789. }