user.m.dart 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. import 'aIDiagnosis.m.dart';
  2. import 'connect.m.dart';
  3. import 'patient.m.dart';
  4. import 'identityApply.m.dart';
  5. import 'authentication.m.dart';
  6. import 'package:fis_jsonrpc/utils.dart';
  7. enum UserInfoStateEnum {
  8. Nonactivated,
  9. Activated,
  10. }
  11. class LoginLockInfoDTO {
  12. DateTime? loginDate;
  13. int times;
  14. LoginLockInfoDTO({
  15. this.loginDate,
  16. this.times = 0,
  17. });
  18. factory LoginLockInfoDTO.fromJson(Map<String, dynamic> map) {
  19. return LoginLockInfoDTO(
  20. loginDate: map['LoginDate'] != null ? DateTime.parse(map['LoginDate']) : null,
  21. times: map['Times'],
  22. );
  23. }
  24. Map<String, dynamic> toJson() {
  25. final map = Map<String, dynamic>();
  26. if(loginDate != null)
  27. map['LoginDate'] = JsonRpcUtils.dateFormat(loginDate!);
  28. map['Times'] = times;
  29. return map;
  30. }
  31. }
  32. class UserDTO extends UserBaseDTO{
  33. String? phone;
  34. String? email;
  35. String? nickName;
  36. String? fullName;
  37. String? organizationCode;
  38. String? organizationName;
  39. String? rootOrganizationCode;
  40. String? rootOrganizationName;
  41. List<String >? authorityGroups;
  42. List<String >? bindDevices;
  43. String? lastIP;
  44. int logintimes;
  45. UserInfoStateEnum userState;
  46. List<String >? roleCodes;
  47. List<String >? rankCodes;
  48. List<String >? positionCodes;
  49. ApplyStateEnum applyState;
  50. String? rankName;
  51. String? positionName;
  52. bool isDirector;
  53. List<String >? fieldList;
  54. List<String >? deletePatientCodes;
  55. bool isBatchExportDiagnoseData;
  56. String? bindAssistantUserCode;
  57. LoginLockInfoDTO? loginLockInfo;
  58. UserDTO({
  59. this.phone,
  60. this.email,
  61. this.nickName,
  62. this.fullName,
  63. this.organizationCode,
  64. this.organizationName,
  65. this.rootOrganizationCode,
  66. this.rootOrganizationName,
  67. this.authorityGroups,
  68. this.bindDevices,
  69. this.lastIP,
  70. this.logintimes = 0,
  71. this.userState = UserInfoStateEnum.Nonactivated,
  72. this.roleCodes,
  73. this.rankCodes,
  74. this.positionCodes,
  75. this.applyState = ApplyStateEnum.NotApply,
  76. this.rankName,
  77. this.positionName,
  78. this.isDirector = false,
  79. this.fieldList,
  80. this.deletePatientCodes,
  81. this.isBatchExportDiagnoseData = false,
  82. this.bindAssistantUserCode,
  83. this.loginLockInfo,
  84. String? userCode,
  85. String? userName,
  86. String? headImageUrl,
  87. DateTime? createTime,
  88. DateTime? updateTime,
  89. }) : super(
  90. userCode: userCode,
  91. userName: userName,
  92. headImageUrl: headImageUrl,
  93. createTime: createTime,
  94. updateTime: updateTime,
  95. );
  96. factory UserDTO.fromJson(Map<String, dynamic> map) {
  97. return UserDTO(
  98. phone: map['Phone'],
  99. email: map['Email'],
  100. nickName: map['NickName'],
  101. fullName: map['FullName'],
  102. organizationCode: map['OrganizationCode'],
  103. organizationName: map['OrganizationName'],
  104. rootOrganizationCode: map['RootOrganizationCode'],
  105. rootOrganizationName: map['RootOrganizationName'],
  106. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  107. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  108. lastIP: map['LastIP'],
  109. logintimes: map['Logintimes'],
  110. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  111. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  112. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  113. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  114. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  115. rankName: map['RankName'],
  116. positionName: map['PositionName'],
  117. isDirector: map['IsDirector'],
  118. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  119. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  120. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  121. bindAssistantUserCode: map['BindAssistantUserCode'],
  122. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  123. userCode: map['UserCode'],
  124. userName: map['UserName'],
  125. headImageUrl: map['HeadImageUrl'],
  126. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  127. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  128. );
  129. }
  130. Map<String, dynamic> toJson() {
  131. final map = super.toJson();
  132. if(phone != null)
  133. map['Phone'] = phone;
  134. if(email != null)
  135. map['Email'] = email;
  136. if(nickName != null)
  137. map['NickName'] = nickName;
  138. if(fullName != null)
  139. map['FullName'] = fullName;
  140. if(organizationCode != null)
  141. map['OrganizationCode'] = organizationCode;
  142. if(organizationName != null)
  143. map['OrganizationName'] = organizationName;
  144. if(rootOrganizationCode != null)
  145. map['RootOrganizationCode'] = rootOrganizationCode;
  146. if(rootOrganizationName != null)
  147. map['RootOrganizationName'] = rootOrganizationName;
  148. if(authorityGroups != null)
  149. map['AuthorityGroups'] = authorityGroups;
  150. if(bindDevices != null)
  151. map['BindDevices'] = bindDevices;
  152. if(lastIP != null)
  153. map['LastIP'] = lastIP;
  154. map['Logintimes'] = logintimes;
  155. map['UserState'] = userState.index;
  156. if(roleCodes != null)
  157. map['RoleCodes'] = roleCodes;
  158. if(rankCodes != null)
  159. map['RankCodes'] = rankCodes;
  160. if(positionCodes != null)
  161. map['PositionCodes'] = positionCodes;
  162. map['ApplyState'] = applyState.index;
  163. if(rankName != null)
  164. map['RankName'] = rankName;
  165. if(positionName != null)
  166. map['PositionName'] = positionName;
  167. map['IsDirector'] = isDirector;
  168. if(fieldList != null)
  169. map['FieldList'] = fieldList;
  170. if(deletePatientCodes != null)
  171. map['DeletePatientCodes'] = deletePatientCodes;
  172. map['IsBatchExportDiagnoseData'] = isBatchExportDiagnoseData;
  173. if(bindAssistantUserCode != null)
  174. map['BindAssistantUserCode'] = bindAssistantUserCode;
  175. if(loginLockInfo != null)
  176. map['LoginLockInfo'] = loginLockInfo;
  177. return map;
  178. }
  179. }
  180. class GetUserInfoRequest extends TokenRequest{
  181. GetUserInfoRequest({
  182. String? token,
  183. }) : super(
  184. token: token,
  185. );
  186. factory GetUserInfoRequest.fromJson(Map<String, dynamic> map) {
  187. return GetUserInfoRequest(
  188. token: map['Token'],
  189. );
  190. }
  191. Map<String, dynamic> toJson() {
  192. final map = super.toJson();
  193. return map;
  194. }
  195. }
  196. class AlterUserInfoRequest extends TokenRequest{
  197. String? phone;
  198. String? email;
  199. String? nickName;
  200. String? fullName;
  201. String? headImageUrl;
  202. String? organizationCode;
  203. String? extensionData;
  204. AlterUserInfoRequest({
  205. this.phone,
  206. this.email,
  207. this.nickName,
  208. this.fullName,
  209. this.headImageUrl,
  210. this.organizationCode,
  211. this.extensionData,
  212. String? token,
  213. }) : super(
  214. token: token,
  215. );
  216. factory AlterUserInfoRequest.fromJson(Map<String, dynamic> map) {
  217. return AlterUserInfoRequest(
  218. phone: map['Phone'],
  219. email: map['Email'],
  220. nickName: map['NickName'],
  221. fullName: map['FullName'],
  222. headImageUrl: map['HeadImageUrl'],
  223. organizationCode: map['OrganizationCode'],
  224. extensionData: map['ExtensionData'],
  225. token: map['Token'],
  226. );
  227. }
  228. Map<String, dynamic> toJson() {
  229. final map = super.toJson();
  230. if(phone != null)
  231. map['Phone'] = phone;
  232. if(email != null)
  233. map['Email'] = email;
  234. if(nickName != null)
  235. map['NickName'] = nickName;
  236. if(fullName != null)
  237. map['FullName'] = fullName;
  238. if(headImageUrl != null)
  239. map['HeadImageUrl'] = headImageUrl;
  240. if(organizationCode != null)
  241. map['OrganizationCode'] = organizationCode;
  242. if(extensionData != null)
  243. map['ExtensionData'] = extensionData;
  244. return map;
  245. }
  246. }
  247. enum OrganizationQueryTypeEnum {
  248. Wait,
  249. Single,
  250. AllDep,
  251. All,
  252. }
  253. class GetUserListRequest extends TokenRequest{
  254. String? keyword;
  255. OrganizationQueryTypeEnum organizationQueryType;
  256. String? organizationCode;
  257. String? rankCode;
  258. String? positionCode;
  259. bool exceptSelf;
  260. GetUserListRequest({
  261. this.keyword,
  262. this.organizationQueryType = OrganizationQueryTypeEnum.Wait,
  263. this.organizationCode,
  264. this.rankCode,
  265. this.positionCode,
  266. this.exceptSelf = false,
  267. String? token,
  268. }) : super(
  269. token: token,
  270. );
  271. factory GetUserListRequest.fromJson(Map<String, dynamic> map) {
  272. return GetUserListRequest(
  273. keyword: map['Keyword'],
  274. organizationQueryType: OrganizationQueryTypeEnum.values.firstWhere((e) => e.index == map['OrganizationQueryType']),
  275. organizationCode: map['OrganizationCode'],
  276. rankCode: map['RankCode'],
  277. positionCode: map['PositionCode'],
  278. exceptSelf: map['ExceptSelf'],
  279. token: map['Token'],
  280. );
  281. }
  282. Map<String, dynamic> toJson() {
  283. final map = super.toJson();
  284. if(keyword != null)
  285. map['Keyword'] = keyword;
  286. map['OrganizationQueryType'] = organizationQueryType.index;
  287. if(organizationCode != null)
  288. map['OrganizationCode'] = organizationCode;
  289. if(rankCode != null)
  290. map['RankCode'] = rankCode;
  291. if(positionCode != null)
  292. map['PositionCode'] = positionCode;
  293. map['ExceptSelf'] = exceptSelf;
  294. return map;
  295. }
  296. }
  297. class RemoveUsersFromOrganizationRequest extends TokenRequest{
  298. List<String >? userCodes;
  299. RemoveUsersFromOrganizationRequest({
  300. this.userCodes,
  301. String? token,
  302. }) : super(
  303. token: token,
  304. );
  305. factory RemoveUsersFromOrganizationRequest.fromJson(Map<String, dynamic> map) {
  306. return RemoveUsersFromOrganizationRequest(
  307. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  308. token: map['Token'],
  309. );
  310. }
  311. Map<String, dynamic> toJson() {
  312. final map = super.toJson();
  313. if(userCodes != null)
  314. map['UserCodes'] = userCodes;
  315. return map;
  316. }
  317. }
  318. class SetUserOrganizationInfoRequest extends TokenRequest{
  319. String? userCode;
  320. List<String >? roleCodes;
  321. List<String >? rankCodes;
  322. List<String >? positionCodes;
  323. String? organizationCode;
  324. SetUserOrganizationInfoRequest({
  325. this.userCode,
  326. this.roleCodes,
  327. this.rankCodes,
  328. this.positionCodes,
  329. this.organizationCode,
  330. String? token,
  331. }) : super(
  332. token: token,
  333. );
  334. factory SetUserOrganizationInfoRequest.fromJson(Map<String, dynamic> map) {
  335. return SetUserOrganizationInfoRequest(
  336. userCode: map['UserCode'],
  337. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  338. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  339. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  340. organizationCode: map['OrganizationCode'],
  341. token: map['Token'],
  342. );
  343. }
  344. Map<String, dynamic> toJson() {
  345. final map = super.toJson();
  346. if(userCode != null)
  347. map['UserCode'] = userCode;
  348. if(roleCodes != null)
  349. map['RoleCodes'] = roleCodes;
  350. if(rankCodes != null)
  351. map['RankCodes'] = rankCodes;
  352. if(positionCodes != null)
  353. map['PositionCodes'] = positionCodes;
  354. if(organizationCode != null)
  355. map['OrganizationCode'] = organizationCode;
  356. return map;
  357. }
  358. }
  359. class AlterPersonInfoRequest {
  360. String? token;
  361. String? nickName;
  362. String? headImageUrl;
  363. AlterPersonInfoRequest({
  364. this.token,
  365. this.nickName,
  366. this.headImageUrl,
  367. });
  368. factory AlterPersonInfoRequest.fromJson(Map<String, dynamic> map) {
  369. return AlterPersonInfoRequest(
  370. token: map['Token'],
  371. nickName: map['NickName'],
  372. headImageUrl: map['HeadImageUrl'],
  373. );
  374. }
  375. Map<String, dynamic> toJson() {
  376. final map = Map<String, dynamic>();
  377. if(token != null)
  378. map['Token'] = token;
  379. if(nickName != null)
  380. map['NickName'] = nickName;
  381. if(headImageUrl != null)
  382. map['HeadImageUrl'] = headImageUrl;
  383. return map;
  384. }
  385. }
  386. class ShareDeviceUserDTO extends BaseDTO{
  387. String? userCode;
  388. String? fullName;
  389. String? phone;
  390. String? headImageUrl;
  391. List<String >? rankNames;
  392. String? rootOrganizationCode;
  393. String? rootOrganizationName;
  394. ShareDeviceUserDTO({
  395. this.userCode,
  396. this.fullName,
  397. this.phone,
  398. this.headImageUrl,
  399. this.rankNames,
  400. this.rootOrganizationCode,
  401. this.rootOrganizationName,
  402. DateTime? createTime,
  403. DateTime? updateTime,
  404. }) : super(
  405. createTime: createTime,
  406. updateTime: updateTime,
  407. );
  408. factory ShareDeviceUserDTO.fromJson(Map<String, dynamic> map) {
  409. return ShareDeviceUserDTO(
  410. userCode: map['UserCode'],
  411. fullName: map['FullName'],
  412. phone: map['Phone'],
  413. headImageUrl: map['HeadImageUrl'],
  414. rankNames: map['RankNames'] != null ? map['RankNames'].cast<String>().toList() : null,
  415. rootOrganizationCode: map['RootOrganizationCode'],
  416. rootOrganizationName: map['RootOrganizationName'],
  417. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  418. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  419. );
  420. }
  421. Map<String, dynamic> toJson() {
  422. final map = super.toJson();
  423. if(userCode != null)
  424. map['UserCode'] = userCode;
  425. if(fullName != null)
  426. map['FullName'] = fullName;
  427. if(phone != null)
  428. map['Phone'] = phone;
  429. if(headImageUrl != null)
  430. map['HeadImageUrl'] = headImageUrl;
  431. if(rankNames != null)
  432. map['RankNames'] = rankNames;
  433. if(rootOrganizationCode != null)
  434. map['RootOrganizationCode'] = rootOrganizationCode;
  435. if(rootOrganizationName != null)
  436. map['RootOrganizationName'] = rootOrganizationName;
  437. return map;
  438. }
  439. }
  440. class GetShareDeviceUsersPageRequest extends PageRequest{
  441. String? deviceCode;
  442. GetShareDeviceUsersPageRequest({
  443. this.deviceCode,
  444. int pageIndex = 0,
  445. int pageSize = 0,
  446. String? token,
  447. }) : super(
  448. pageIndex: pageIndex,
  449. pageSize: pageSize,
  450. token: token,
  451. );
  452. factory GetShareDeviceUsersPageRequest.fromJson(Map<String, dynamic> map) {
  453. return GetShareDeviceUsersPageRequest(
  454. deviceCode: map['DeviceCode'],
  455. pageIndex: map['PageIndex'],
  456. pageSize: map['PageSize'],
  457. token: map['Token'],
  458. );
  459. }
  460. Map<String, dynamic> toJson() {
  461. final map = super.toJson();
  462. if(deviceCode != null)
  463. map['DeviceCode'] = deviceCode;
  464. return map;
  465. }
  466. }
  467. class UserFeatureInfoResult {
  468. String? featureCode;
  469. String? featureName;
  470. String? fatherCode;
  471. String? uniqueCode;
  472. UserFeatureInfoResult({
  473. this.featureCode,
  474. this.featureName,
  475. this.fatherCode,
  476. this.uniqueCode,
  477. });
  478. factory UserFeatureInfoResult.fromJson(Map<String, dynamic> map) {
  479. return UserFeatureInfoResult(
  480. featureCode: map['FeatureCode'],
  481. featureName: map['FeatureName'],
  482. fatherCode: map['FatherCode'],
  483. uniqueCode: map['UniqueCode'],
  484. );
  485. }
  486. Map<String, dynamic> toJson() {
  487. final map = Map<String, dynamic>();
  488. if(featureCode != null)
  489. map['FeatureCode'] = featureCode;
  490. if(featureName != null)
  491. map['FeatureName'] = featureName;
  492. if(fatherCode != null)
  493. map['FatherCode'] = fatherCode;
  494. if(uniqueCode != null)
  495. map['UniqueCode'] = uniqueCode;
  496. return map;
  497. }
  498. }
  499. class GetUserByCodeRequest extends TokenRequest{
  500. String? userCode;
  501. GetUserByCodeRequest({
  502. this.userCode,
  503. String? token,
  504. }) : super(
  505. token: token,
  506. );
  507. factory GetUserByCodeRequest.fromJson(Map<String, dynamic> map) {
  508. return GetUserByCodeRequest(
  509. userCode: map['UserCode'],
  510. token: map['Token'],
  511. );
  512. }
  513. Map<String, dynamic> toJson() {
  514. final map = super.toJson();
  515. if(userCode != null)
  516. map['UserCode'] = userCode;
  517. return map;
  518. }
  519. }