user.m.dart 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985
  1. import 'liveConsultation.m.dart';
  2. import 'identityApply.m.dart';
  3. import 'package:fis_jsonrpc/utils.dart';
  4. enum UserInfoStateEnum {
  5. Nonactivated,
  6. Activated,
  7. }
  8. class LoginLockInfoDTO {
  9. DateTime? loginDate;
  10. int times;
  11. LoginLockInfoDTO({
  12. this.loginDate,
  13. this.times = 0,
  14. });
  15. factory LoginLockInfoDTO.fromJson(Map<String, dynamic> map) {
  16. return LoginLockInfoDTO(
  17. loginDate: map['LoginDate'] != null ? DateTime.parse(map['LoginDate']) : null,
  18. times: map['Times'],
  19. );
  20. }
  21. Map<String, dynamic> toJson() {
  22. final map = Map<String, dynamic>();
  23. if(loginDate != null)
  24. map['LoginDate'] = JsonRpcUtils.dateFormat(loginDate!);
  25. map['Times'] = times;
  26. return map;
  27. }
  28. }
  29. class UserDTO extends UserBaseDTO{
  30. String? phone;
  31. String? email;
  32. String? nickName;
  33. String? fullName;
  34. String? organizationCode;
  35. String? organizationName;
  36. String? rootOrganizationCode;
  37. String? rootOrganizationName;
  38. List<String >? authorityGroups;
  39. List<String >? bindDevices;
  40. String? lastIP;
  41. int logintimes;
  42. UserInfoStateEnum userState;
  43. List<String >? roleCodes;
  44. List<String >? rankCodes;
  45. List<String >? positionCodes;
  46. ApplyStateEnum applyState;
  47. String? rankName;
  48. String? positionName;
  49. bool isDirector;
  50. List<String >? fieldList;
  51. List<String >? deletePatientCodes;
  52. bool isBatchExportDiagnoseData;
  53. String? bindAssistantUserCode;
  54. String? bindAssistantDoctorUserCode;
  55. LoginLockInfoDTO? loginLockInfo;
  56. String? signature;
  57. String? language;
  58. bool enableReportLabel;
  59. UserDTO({
  60. this.phone,
  61. this.email,
  62. this.nickName,
  63. this.fullName,
  64. this.organizationCode,
  65. this.organizationName,
  66. this.rootOrganizationCode,
  67. this.rootOrganizationName,
  68. this.authorityGroups,
  69. this.bindDevices,
  70. this.lastIP,
  71. this.logintimes = 0,
  72. this.userState = UserInfoStateEnum.Nonactivated,
  73. this.roleCodes,
  74. this.rankCodes,
  75. this.positionCodes,
  76. this.applyState = ApplyStateEnum.NotApply,
  77. this.rankName,
  78. this.positionName,
  79. this.isDirector = false,
  80. this.fieldList,
  81. this.deletePatientCodes,
  82. this.isBatchExportDiagnoseData = false,
  83. this.bindAssistantUserCode,
  84. this.bindAssistantDoctorUserCode,
  85. this.loginLockInfo,
  86. this.signature,
  87. this.language,
  88. this.enableReportLabel = false,
  89. String? userCode,
  90. String? userName,
  91. String? headImageUrl,
  92. DateTime? createTime,
  93. DateTime? updateTime,
  94. }) : super(
  95. userCode: userCode,
  96. userName: userName,
  97. headImageUrl: headImageUrl,
  98. createTime: createTime,
  99. updateTime: updateTime,
  100. );
  101. factory UserDTO.fromJson(Map<String, dynamic> map) {
  102. return UserDTO(
  103. phone: map['Phone'],
  104. email: map['Email'],
  105. nickName: map['NickName'],
  106. fullName: map['FullName'],
  107. organizationCode: map['OrganizationCode'],
  108. organizationName: map['OrganizationName'],
  109. rootOrganizationCode: map['RootOrganizationCode'],
  110. rootOrganizationName: map['RootOrganizationName'],
  111. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  112. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  113. lastIP: map['LastIP'],
  114. logintimes: map['Logintimes'],
  115. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  116. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  117. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  118. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  119. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  120. rankName: map['RankName'],
  121. positionName: map['PositionName'],
  122. isDirector: map['IsDirector'],
  123. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  124. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  125. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  126. bindAssistantUserCode: map['BindAssistantUserCode'],
  127. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  128. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  129. signature: map['Signature'],
  130. language: map['Language'],
  131. enableReportLabel: map['EnableReportLabel'],
  132. userCode: map['UserCode'],
  133. userName: map['UserName'],
  134. headImageUrl: map['HeadImageUrl'],
  135. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  136. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  137. );
  138. }
  139. Map<String, dynamic> toJson() {
  140. final map = super.toJson();
  141. if(phone != null)
  142. map['Phone'] = phone;
  143. if(email != null)
  144. map['Email'] = email;
  145. if(nickName != null)
  146. map['NickName'] = nickName;
  147. if(fullName != null)
  148. map['FullName'] = fullName;
  149. if(organizationCode != null)
  150. map['OrganizationCode'] = organizationCode;
  151. if(organizationName != null)
  152. map['OrganizationName'] = organizationName;
  153. if(rootOrganizationCode != null)
  154. map['RootOrganizationCode'] = rootOrganizationCode;
  155. if(rootOrganizationName != null)
  156. map['RootOrganizationName'] = rootOrganizationName;
  157. if(authorityGroups != null)
  158. map['AuthorityGroups'] = authorityGroups;
  159. if(bindDevices != null)
  160. map['BindDevices'] = bindDevices;
  161. if(lastIP != null)
  162. map['LastIP'] = lastIP;
  163. map['Logintimes'] = logintimes;
  164. map['UserState'] = userState.index;
  165. if(roleCodes != null)
  166. map['RoleCodes'] = roleCodes;
  167. if(rankCodes != null)
  168. map['RankCodes'] = rankCodes;
  169. if(positionCodes != null)
  170. map['PositionCodes'] = positionCodes;
  171. map['ApplyState'] = applyState.index;
  172. if(rankName != null)
  173. map['RankName'] = rankName;
  174. if(positionName != null)
  175. map['PositionName'] = positionName;
  176. map['IsDirector'] = isDirector;
  177. if(fieldList != null)
  178. map['FieldList'] = fieldList;
  179. if(deletePatientCodes != null)
  180. map['DeletePatientCodes'] = deletePatientCodes;
  181. map['IsBatchExportDiagnoseData'] = isBatchExportDiagnoseData;
  182. if(bindAssistantUserCode != null)
  183. map['BindAssistantUserCode'] = bindAssistantUserCode;
  184. if(bindAssistantDoctorUserCode != null)
  185. map['BindAssistantDoctorUserCode'] = bindAssistantDoctorUserCode;
  186. if(loginLockInfo != null)
  187. map['LoginLockInfo'] = loginLockInfo;
  188. if(signature != null)
  189. map['Signature'] = signature;
  190. if(language != null)
  191. map['Language'] = language;
  192. map['EnableReportLabel'] = enableReportLabel;
  193. return map;
  194. }
  195. }
  196. class GetUserInfoRequest extends TokenRequest{
  197. GetUserInfoRequest({
  198. String? token,
  199. }) : super(
  200. token: token,
  201. );
  202. factory GetUserInfoRequest.fromJson(Map<String, dynamic> map) {
  203. return GetUserInfoRequest(
  204. token: map['Token'],
  205. );
  206. }
  207. Map<String, dynamic> toJson() {
  208. final map = super.toJson();
  209. return map;
  210. }
  211. }
  212. class AlterUserInfoRequest extends TokenRequest{
  213. String? phone;
  214. String? email;
  215. String? nickName;
  216. String? fullName;
  217. String? headImageUrl;
  218. String? organizationCode;
  219. String? extensionData;
  220. AlterUserInfoRequest({
  221. this.phone,
  222. this.email,
  223. this.nickName,
  224. this.fullName,
  225. this.headImageUrl,
  226. this.organizationCode,
  227. this.extensionData,
  228. String? token,
  229. }) : super(
  230. token: token,
  231. );
  232. factory AlterUserInfoRequest.fromJson(Map<String, dynamic> map) {
  233. return AlterUserInfoRequest(
  234. phone: map['Phone'],
  235. email: map['Email'],
  236. nickName: map['NickName'],
  237. fullName: map['FullName'],
  238. headImageUrl: map['HeadImageUrl'],
  239. organizationCode: map['OrganizationCode'],
  240. extensionData: map['ExtensionData'],
  241. token: map['Token'],
  242. );
  243. }
  244. Map<String, dynamic> toJson() {
  245. final map = super.toJson();
  246. if(phone != null)
  247. map['Phone'] = phone;
  248. if(email != null)
  249. map['Email'] = email;
  250. if(nickName != null)
  251. map['NickName'] = nickName;
  252. if(fullName != null)
  253. map['FullName'] = fullName;
  254. if(headImageUrl != null)
  255. map['HeadImageUrl'] = headImageUrl;
  256. if(organizationCode != null)
  257. map['OrganizationCode'] = organizationCode;
  258. if(extensionData != null)
  259. map['ExtensionData'] = extensionData;
  260. return map;
  261. }
  262. }
  263. class UserExtendDTO extends UserDTO{
  264. String? roleName;
  265. UserExtendDTO({
  266. this.roleName,
  267. String? phone,
  268. String? email,
  269. String? nickName,
  270. String? fullName,
  271. String? organizationCode,
  272. String? organizationName,
  273. String? rootOrganizationCode,
  274. String? rootOrganizationName,
  275. List<String >? authorityGroups,
  276. List<String >? bindDevices,
  277. String? lastIP,
  278. int logintimes = 0,
  279. UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
  280. List<String >? roleCodes,
  281. List<String >? rankCodes,
  282. List<String >? positionCodes,
  283. ApplyStateEnum applyState = ApplyStateEnum.NotApply,
  284. String? rankName,
  285. String? positionName,
  286. bool isDirector = false,
  287. List<String >? fieldList,
  288. List<String >? deletePatientCodes,
  289. bool isBatchExportDiagnoseData = false,
  290. String? bindAssistantUserCode,
  291. String? bindAssistantDoctorUserCode,
  292. LoginLockInfoDTO? loginLockInfo,
  293. String? signature,
  294. String? language,
  295. bool enableReportLabel = false,
  296. String? userCode,
  297. String? userName,
  298. String? headImageUrl,
  299. DateTime? createTime,
  300. DateTime? updateTime,
  301. }) : super(
  302. phone: phone,
  303. email: email,
  304. nickName: nickName,
  305. fullName: fullName,
  306. organizationCode: organizationCode,
  307. organizationName: organizationName,
  308. rootOrganizationCode: rootOrganizationCode,
  309. rootOrganizationName: rootOrganizationName,
  310. authorityGroups: authorityGroups,
  311. bindDevices: bindDevices,
  312. lastIP: lastIP,
  313. logintimes: logintimes,
  314. userState: userState,
  315. roleCodes: roleCodes,
  316. rankCodes: rankCodes,
  317. positionCodes: positionCodes,
  318. applyState: applyState,
  319. rankName: rankName,
  320. positionName: positionName,
  321. isDirector: isDirector,
  322. fieldList: fieldList,
  323. deletePatientCodes: deletePatientCodes,
  324. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  325. bindAssistantUserCode: bindAssistantUserCode,
  326. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  327. loginLockInfo: loginLockInfo,
  328. signature: signature,
  329. language: language,
  330. enableReportLabel: enableReportLabel,
  331. userCode: userCode,
  332. userName: userName,
  333. headImageUrl: headImageUrl,
  334. createTime: createTime,
  335. updateTime: updateTime,
  336. );
  337. factory UserExtendDTO.fromJson(Map<String, dynamic> map) {
  338. return UserExtendDTO(
  339. roleName: map['RoleName'],
  340. phone: map['Phone'],
  341. email: map['Email'],
  342. nickName: map['NickName'],
  343. fullName: map['FullName'],
  344. organizationCode: map['OrganizationCode'],
  345. organizationName: map['OrganizationName'],
  346. rootOrganizationCode: map['RootOrganizationCode'],
  347. rootOrganizationName: map['RootOrganizationName'],
  348. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  349. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  350. lastIP: map['LastIP'],
  351. logintimes: map['Logintimes'],
  352. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  353. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  354. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  355. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  356. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  357. rankName: map['RankName'],
  358. positionName: map['PositionName'],
  359. isDirector: map['IsDirector'],
  360. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  361. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  362. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  363. bindAssistantUserCode: map['BindAssistantUserCode'],
  364. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  365. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  366. signature: map['Signature'],
  367. language: map['Language'],
  368. enableReportLabel: map['EnableReportLabel'],
  369. userCode: map['UserCode'],
  370. userName: map['UserName'],
  371. headImageUrl: map['HeadImageUrl'],
  372. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  373. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  374. );
  375. }
  376. Map<String, dynamic> toJson() {
  377. final map = super.toJson();
  378. if(roleName != null)
  379. map['RoleName'] = roleName;
  380. return map;
  381. }
  382. }
  383. enum OrganizationQueryTypeEnum {
  384. Wait,
  385. Single,
  386. AllDep,
  387. All,
  388. }
  389. class GetUserListRequest extends TokenRequest{
  390. String? keyword;
  391. OrganizationQueryTypeEnum organizationQueryType;
  392. String? organizationCode;
  393. String? rankCode;
  394. String? positionCode;
  395. bool exceptSelf;
  396. String? language;
  397. GetUserListRequest({
  398. this.keyword,
  399. this.organizationQueryType = OrganizationQueryTypeEnum.Wait,
  400. this.organizationCode,
  401. this.rankCode,
  402. this.positionCode,
  403. this.exceptSelf = false,
  404. this.language,
  405. String? token,
  406. }) : super(
  407. token: token,
  408. );
  409. factory GetUserListRequest.fromJson(Map<String, dynamic> map) {
  410. return GetUserListRequest(
  411. keyword: map['Keyword'],
  412. organizationQueryType: OrganizationQueryTypeEnum.values.firstWhere((e) => e.index == map['OrganizationQueryType']),
  413. organizationCode: map['OrganizationCode'],
  414. rankCode: map['RankCode'],
  415. positionCode: map['PositionCode'],
  416. exceptSelf: map['ExceptSelf'],
  417. language: map['Language'],
  418. token: map['Token'],
  419. );
  420. }
  421. Map<String, dynamic> toJson() {
  422. final map = super.toJson();
  423. if(keyword != null)
  424. map['Keyword'] = keyword;
  425. map['OrganizationQueryType'] = organizationQueryType.index;
  426. if(organizationCode != null)
  427. map['OrganizationCode'] = organizationCode;
  428. if(rankCode != null)
  429. map['RankCode'] = rankCode;
  430. if(positionCode != null)
  431. map['PositionCode'] = positionCode;
  432. map['ExceptSelf'] = exceptSelf;
  433. if(language != null)
  434. map['Language'] = language;
  435. return map;
  436. }
  437. }
  438. class RemoveUsersFromOrganizationRequest extends TokenRequest{
  439. List<String >? userCodes;
  440. RemoveUsersFromOrganizationRequest({
  441. this.userCodes,
  442. String? token,
  443. }) : super(
  444. token: token,
  445. );
  446. factory RemoveUsersFromOrganizationRequest.fromJson(Map<String, dynamic> map) {
  447. return RemoveUsersFromOrganizationRequest(
  448. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  449. token: map['Token'],
  450. );
  451. }
  452. Map<String, dynamic> toJson() {
  453. final map = super.toJson();
  454. if(userCodes != null)
  455. map['UserCodes'] = userCodes;
  456. return map;
  457. }
  458. }
  459. class SetUserOrganizationInfoRequest extends TokenRequest{
  460. String? userCode;
  461. List<String >? roleCodes;
  462. List<String >? rankCodes;
  463. List<String >? positionCodes;
  464. String? organizationCode;
  465. SetUserOrganizationInfoRequest({
  466. this.userCode,
  467. this.roleCodes,
  468. this.rankCodes,
  469. this.positionCodes,
  470. this.organizationCode,
  471. String? token,
  472. }) : super(
  473. token: token,
  474. );
  475. factory SetUserOrganizationInfoRequest.fromJson(Map<String, dynamic> map) {
  476. return SetUserOrganizationInfoRequest(
  477. userCode: map['UserCode'],
  478. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  479. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  480. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  481. organizationCode: map['OrganizationCode'],
  482. token: map['Token'],
  483. );
  484. }
  485. Map<String, dynamic> toJson() {
  486. final map = super.toJson();
  487. if(userCode != null)
  488. map['UserCode'] = userCode;
  489. if(roleCodes != null)
  490. map['RoleCodes'] = roleCodes;
  491. if(rankCodes != null)
  492. map['RankCodes'] = rankCodes;
  493. if(positionCodes != null)
  494. map['PositionCodes'] = positionCodes;
  495. if(organizationCode != null)
  496. map['OrganizationCode'] = organizationCode;
  497. return map;
  498. }
  499. }
  500. class AlterPersonInfoRequest {
  501. String? token;
  502. String? nickName;
  503. String? headImageUrl;
  504. AlterPersonInfoRequest({
  505. this.token,
  506. this.nickName,
  507. this.headImageUrl,
  508. });
  509. factory AlterPersonInfoRequest.fromJson(Map<String, dynamic> map) {
  510. return AlterPersonInfoRequest(
  511. token: map['Token'],
  512. nickName: map['NickName'],
  513. headImageUrl: map['HeadImageUrl'],
  514. );
  515. }
  516. Map<String, dynamic> toJson() {
  517. final map = Map<String, dynamic>();
  518. if(token != null)
  519. map['Token'] = token;
  520. if(nickName != null)
  521. map['NickName'] = nickName;
  522. if(headImageUrl != null)
  523. map['HeadImageUrl'] = headImageUrl;
  524. return map;
  525. }
  526. }
  527. class ShareDeviceUserDTO extends BaseDTO{
  528. String? userCode;
  529. String? fullName;
  530. String? phone;
  531. String? headImageUrl;
  532. List<String >? rankNames;
  533. String? rootOrganizationCode;
  534. String? rootOrganizationName;
  535. ShareDeviceUserDTO({
  536. this.userCode,
  537. this.fullName,
  538. this.phone,
  539. this.headImageUrl,
  540. this.rankNames,
  541. this.rootOrganizationCode,
  542. this.rootOrganizationName,
  543. DateTime? createTime,
  544. DateTime? updateTime,
  545. }) : super(
  546. createTime: createTime,
  547. updateTime: updateTime,
  548. );
  549. factory ShareDeviceUserDTO.fromJson(Map<String, dynamic> map) {
  550. return ShareDeviceUserDTO(
  551. userCode: map['UserCode'],
  552. fullName: map['FullName'],
  553. phone: map['Phone'],
  554. headImageUrl: map['HeadImageUrl'],
  555. rankNames: map['RankNames'] != null ? map['RankNames'].cast<String>().toList() : null,
  556. rootOrganizationCode: map['RootOrganizationCode'],
  557. rootOrganizationName: map['RootOrganizationName'],
  558. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  559. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  560. );
  561. }
  562. Map<String, dynamic> toJson() {
  563. final map = super.toJson();
  564. if(userCode != null)
  565. map['UserCode'] = userCode;
  566. if(fullName != null)
  567. map['FullName'] = fullName;
  568. if(phone != null)
  569. map['Phone'] = phone;
  570. if(headImageUrl != null)
  571. map['HeadImageUrl'] = headImageUrl;
  572. if(rankNames != null)
  573. map['RankNames'] = rankNames;
  574. if(rootOrganizationCode != null)
  575. map['RootOrganizationCode'] = rootOrganizationCode;
  576. if(rootOrganizationName != null)
  577. map['RootOrganizationName'] = rootOrganizationName;
  578. return map;
  579. }
  580. }
  581. class GetShareDeviceUsersPageRequest extends PageRequest{
  582. String? deviceCode;
  583. GetShareDeviceUsersPageRequest({
  584. this.deviceCode,
  585. int pageIndex = 0,
  586. int pageSize = 0,
  587. String? token,
  588. }) : super(
  589. pageIndex: pageIndex,
  590. pageSize: pageSize,
  591. token: token,
  592. );
  593. factory GetShareDeviceUsersPageRequest.fromJson(Map<String, dynamic> map) {
  594. return GetShareDeviceUsersPageRequest(
  595. deviceCode: map['DeviceCode'],
  596. pageIndex: map['PageIndex'],
  597. pageSize: map['PageSize'],
  598. token: map['Token'],
  599. );
  600. }
  601. Map<String, dynamic> toJson() {
  602. final map = super.toJson();
  603. if(deviceCode != null)
  604. map['DeviceCode'] = deviceCode;
  605. return map;
  606. }
  607. }
  608. class UserFeatureInfoResult {
  609. String? featureCode;
  610. String? featureName;
  611. String? fatherCode;
  612. String? uniqueCode;
  613. UserFeatureInfoResult({
  614. this.featureCode,
  615. this.featureName,
  616. this.fatherCode,
  617. this.uniqueCode,
  618. });
  619. factory UserFeatureInfoResult.fromJson(Map<String, dynamic> map) {
  620. return UserFeatureInfoResult(
  621. featureCode: map['FeatureCode'],
  622. featureName: map['FeatureName'],
  623. fatherCode: map['FatherCode'],
  624. uniqueCode: map['UniqueCode'],
  625. );
  626. }
  627. Map<String, dynamic> toJson() {
  628. final map = Map<String, dynamic>();
  629. if(featureCode != null)
  630. map['FeatureCode'] = featureCode;
  631. if(featureName != null)
  632. map['FeatureName'] = featureName;
  633. if(fatherCode != null)
  634. map['FatherCode'] = fatherCode;
  635. if(uniqueCode != null)
  636. map['UniqueCode'] = uniqueCode;
  637. return map;
  638. }
  639. }
  640. class UserInfoByCodeDTO extends UserDTO{
  641. String? bindAssistantUserName;
  642. String? bindAssistantDoctorUserName;
  643. UserInfoByCodeDTO({
  644. this.bindAssistantUserName,
  645. this.bindAssistantDoctorUserName,
  646. String? phone,
  647. String? email,
  648. String? nickName,
  649. String? fullName,
  650. String? organizationCode,
  651. String? organizationName,
  652. String? rootOrganizationCode,
  653. String? rootOrganizationName,
  654. List<String >? authorityGroups,
  655. List<String >? bindDevices,
  656. String? lastIP,
  657. int logintimes = 0,
  658. UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
  659. List<String >? roleCodes,
  660. List<String >? rankCodes,
  661. List<String >? positionCodes,
  662. ApplyStateEnum applyState = ApplyStateEnum.NotApply,
  663. String? rankName,
  664. String? positionName,
  665. bool isDirector = false,
  666. List<String >? fieldList,
  667. List<String >? deletePatientCodes,
  668. bool isBatchExportDiagnoseData = false,
  669. String? bindAssistantUserCode,
  670. String? bindAssistantDoctorUserCode,
  671. LoginLockInfoDTO? loginLockInfo,
  672. String? signature,
  673. String? language,
  674. bool enableReportLabel = false,
  675. String? userCode,
  676. String? userName,
  677. String? headImageUrl,
  678. DateTime? createTime,
  679. DateTime? updateTime,
  680. }) : super(
  681. phone: phone,
  682. email: email,
  683. nickName: nickName,
  684. fullName: fullName,
  685. organizationCode: organizationCode,
  686. organizationName: organizationName,
  687. rootOrganizationCode: rootOrganizationCode,
  688. rootOrganizationName: rootOrganizationName,
  689. authorityGroups: authorityGroups,
  690. bindDevices: bindDevices,
  691. lastIP: lastIP,
  692. logintimes: logintimes,
  693. userState: userState,
  694. roleCodes: roleCodes,
  695. rankCodes: rankCodes,
  696. positionCodes: positionCodes,
  697. applyState: applyState,
  698. rankName: rankName,
  699. positionName: positionName,
  700. isDirector: isDirector,
  701. fieldList: fieldList,
  702. deletePatientCodes: deletePatientCodes,
  703. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  704. bindAssistantUserCode: bindAssistantUserCode,
  705. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  706. loginLockInfo: loginLockInfo,
  707. signature: signature,
  708. language: language,
  709. enableReportLabel: enableReportLabel,
  710. userCode: userCode,
  711. userName: userName,
  712. headImageUrl: headImageUrl,
  713. createTime: createTime,
  714. updateTime: updateTime,
  715. );
  716. factory UserInfoByCodeDTO.fromJson(Map<String, dynamic> map) {
  717. return UserInfoByCodeDTO(
  718. bindAssistantUserName: map['BindAssistantUserName'],
  719. bindAssistantDoctorUserName: map['BindAssistantDoctorUserName'],
  720. phone: map['Phone'],
  721. email: map['Email'],
  722. nickName: map['NickName'],
  723. fullName: map['FullName'],
  724. organizationCode: map['OrganizationCode'],
  725. organizationName: map['OrganizationName'],
  726. rootOrganizationCode: map['RootOrganizationCode'],
  727. rootOrganizationName: map['RootOrganizationName'],
  728. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  729. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  730. lastIP: map['LastIP'],
  731. logintimes: map['Logintimes'],
  732. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  733. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  734. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  735. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  736. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  737. rankName: map['RankName'],
  738. positionName: map['PositionName'],
  739. isDirector: map['IsDirector'],
  740. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  741. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  742. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  743. bindAssistantUserCode: map['BindAssistantUserCode'],
  744. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  745. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  746. signature: map['Signature'],
  747. language: map['Language'],
  748. enableReportLabel: map['EnableReportLabel'],
  749. userCode: map['UserCode'],
  750. userName: map['UserName'],
  751. headImageUrl: map['HeadImageUrl'],
  752. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  753. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  754. );
  755. }
  756. Map<String, dynamic> toJson() {
  757. final map = super.toJson();
  758. if(bindAssistantUserName != null)
  759. map['BindAssistantUserName'] = bindAssistantUserName;
  760. if(bindAssistantDoctorUserName != null)
  761. map['BindAssistantDoctorUserName'] = bindAssistantDoctorUserName;
  762. return map;
  763. }
  764. }
  765. class GetUserByCodeRequest extends TokenRequest{
  766. String? userCode;
  767. GetUserByCodeRequest({
  768. this.userCode,
  769. String? token,
  770. }) : super(
  771. token: token,
  772. );
  773. factory GetUserByCodeRequest.fromJson(Map<String, dynamic> map) {
  774. return GetUserByCodeRequest(
  775. userCode: map['UserCode'],
  776. token: map['Token'],
  777. );
  778. }
  779. Map<String, dynamic> toJson() {
  780. final map = super.toJson();
  781. if(userCode != null)
  782. map['UserCode'] = userCode;
  783. return map;
  784. }
  785. }
  786. enum CommonSettingsEnum {
  787. Signature,
  788. Language,
  789. EnableReportLabel,
  790. }
  791. class CommonSettingsRequest extends TokenRequest{
  792. CommonSettingsEnum settingType;
  793. String? value;
  794. CommonSettingsRequest({
  795. this.settingType = CommonSettingsEnum.Signature,
  796. this.value,
  797. String? token,
  798. }) : super(
  799. token: token,
  800. );
  801. factory CommonSettingsRequest.fromJson(Map<String, dynamic> map) {
  802. return CommonSettingsRequest(
  803. settingType: CommonSettingsEnum.values.firstWhere((e) => e.index == map['SettingType']),
  804. value: map['Value'],
  805. token: map['Token'],
  806. );
  807. }
  808. Map<String, dynamic> toJson() {
  809. final map = super.toJson();
  810. map['SettingType'] = settingType.index;
  811. if(value != null)
  812. map['Value'] = value;
  813. return map;
  814. }
  815. }
  816. class RefreshStaticticRecordsRequest {
  817. String? userCode;
  818. bool inExecutor;
  819. RefreshStaticticRecordsRequest({
  820. this.userCode,
  821. this.inExecutor = false,
  822. });
  823. factory RefreshStaticticRecordsRequest.fromJson(Map<String, dynamic> map) {
  824. return RefreshStaticticRecordsRequest(
  825. userCode: map['UserCode'],
  826. inExecutor: map['InExecutor'],
  827. );
  828. }
  829. Map<String, dynamic> toJson() {
  830. final map = Map<String, dynamic>();
  831. if(userCode != null)
  832. map['UserCode'] = userCode;
  833. map['InExecutor'] = inExecutor;
  834. return map;
  835. }
  836. }
  837. enum ScheduleTypeEnum {
  838. Consultation,
  839. Training,
  840. }
  841. class ClientScheduleDTO {
  842. String? title;
  843. TransactionStatusEnum status;
  844. ScheduleTypeEnum scheduleType;
  845. DateTime? startTime;
  846. DateTime? endTime;
  847. String? relevanceCode;
  848. ClientScheduleDTO({
  849. this.title,
  850. this.status = TransactionStatusEnum.Applied,
  851. this.scheduleType = ScheduleTypeEnum.Consultation,
  852. this.startTime,
  853. this.endTime,
  854. this.relevanceCode,
  855. });
  856. factory ClientScheduleDTO.fromJson(Map<String, dynamic> map) {
  857. return ClientScheduleDTO(
  858. title: map['Title'],
  859. status: TransactionStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  860. scheduleType: ScheduleTypeEnum.values.firstWhere((e) => e.index == map['ScheduleType']),
  861. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  862. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  863. relevanceCode: map['RelevanceCode'],
  864. );
  865. }
  866. Map<String, dynamic> toJson() {
  867. final map = Map<String, dynamic>();
  868. if(title != null)
  869. map['Title'] = title;
  870. map['Status'] = status.index;
  871. map['ScheduleType'] = scheduleType.index;
  872. if(startTime != null)
  873. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  874. if(endTime != null)
  875. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  876. if(relevanceCode != null)
  877. map['RelevanceCode'] = relevanceCode;
  878. return map;
  879. }
  880. }
  881. class FindSchedulesRequest extends TokenRequest{
  882. DateTime? startTime;
  883. DateTime? endTime;
  884. FindSchedulesRequest({
  885. this.startTime,
  886. this.endTime,
  887. String? token,
  888. }) : super(
  889. token: token,
  890. );
  891. factory FindSchedulesRequest.fromJson(Map<String, dynamic> map) {
  892. return FindSchedulesRequest(
  893. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  894. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  895. token: map['Token'],
  896. );
  897. }
  898. Map<String, dynamic> toJson() {
  899. final map = super.toJson();
  900. if(startTime != null)
  901. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  902. if(endTime != null)
  903. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  904. return map;
  905. }
  906. }