identityApply.m.dart 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import 'liveConsultation.m.dart';
  2. enum ApplyStateEnum {
  3. NotApply,
  4. Applying,
  5. Refused,
  6. Passed,
  7. }
  8. class IdentityApplyDTO extends BaseDTO{
  9. String? identityApplyCode;
  10. String? userCode;
  11. String? applyRoleCode;
  12. List<String >? identityCard;
  13. List<String >? licenseCard;
  14. ApplyStateEnum applyState;
  15. String? applyNote;
  16. List<String >? fieldList;
  17. IdentityApplyDTO({
  18. this.identityApplyCode,
  19. this.userCode,
  20. this.applyRoleCode,
  21. this.identityCard,
  22. this.licenseCard,
  23. this.applyState = ApplyStateEnum.NotApply,
  24. this.applyNote,
  25. this.fieldList,
  26. DateTime? createTime,
  27. DateTime? updateTime,
  28. }) : super(
  29. createTime: createTime,
  30. updateTime: updateTime,
  31. );
  32. factory IdentityApplyDTO.fromJson(Map<String, dynamic> map) {
  33. return IdentityApplyDTO(
  34. identityApplyCode: map['IdentityApplyCode'],
  35. userCode: map['UserCode'],
  36. applyRoleCode: map['ApplyRoleCode'],
  37. identityCard: map['IdentityCard'] != null ? map['IdentityCard'].cast<String>().toList() : null,
  38. licenseCard: map['LicenseCard'] != null ? map['LicenseCard'].cast<String>().toList() : null,
  39. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  40. applyNote: map['ApplyNote'],
  41. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  42. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  43. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  44. );
  45. }
  46. Map<String, dynamic> toJson() {
  47. final map = super.toJson();
  48. if(identityApplyCode != null)
  49. map['IdentityApplyCode'] = identityApplyCode;
  50. if(userCode != null)
  51. map['UserCode'] = userCode;
  52. if(applyRoleCode != null)
  53. map['ApplyRoleCode'] = applyRoleCode;
  54. if(identityCard != null)
  55. map['IdentityCard'] = identityCard;
  56. if(licenseCard != null)
  57. map['LicenseCard'] = licenseCard;
  58. map['ApplyState'] = applyState.index;
  59. if(applyNote != null)
  60. map['ApplyNote'] = applyNote;
  61. if(fieldList != null)
  62. map['FieldList'] = fieldList;
  63. return map;
  64. }
  65. }
  66. class GetLastIdentityApplyRequest extends TokenRequest{
  67. String? applyRoleCode;
  68. GetLastIdentityApplyRequest({
  69. this.applyRoleCode,
  70. String? token,
  71. }) : super(
  72. token: token,
  73. );
  74. factory GetLastIdentityApplyRequest.fromJson(Map<String, dynamic> map) {
  75. return GetLastIdentityApplyRequest(
  76. applyRoleCode: map['ApplyRoleCode'],
  77. token: map['Token'],
  78. );
  79. }
  80. Map<String, dynamic> toJson() {
  81. final map = super.toJson();
  82. if(applyRoleCode != null)
  83. map['ApplyRoleCode'] = applyRoleCode;
  84. return map;
  85. }
  86. }
  87. class ApplyForRequest {
  88. String? token;
  89. String? extensionData;
  90. String? applyRoleCode;
  91. List<String >? identityCard;
  92. List<String >? licenseCard;
  93. List<String >? fieldList;
  94. ApplyForRequest({
  95. this.token,
  96. this.extensionData,
  97. this.applyRoleCode,
  98. this.identityCard,
  99. this.licenseCard,
  100. this.fieldList,
  101. });
  102. factory ApplyForRequest.fromJson(Map<String, dynamic> map) {
  103. return ApplyForRequest(
  104. token: map['Token'],
  105. extensionData: map['ExtensionData'],
  106. applyRoleCode: map['ApplyRoleCode'],
  107. identityCard: map['IdentityCard'] != null ? map['IdentityCard'].cast<String>().toList() : null,
  108. licenseCard: map['LicenseCard'] != null ? map['LicenseCard'].cast<String>().toList() : null,
  109. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  110. );
  111. }
  112. Map<String, dynamic> toJson() {
  113. final map = Map<String, dynamic>();
  114. if(token != null)
  115. map['Token'] = token;
  116. if(extensionData != null)
  117. map['ExtensionData'] = extensionData;
  118. if(applyRoleCode != null)
  119. map['ApplyRoleCode'] = applyRoleCode;
  120. if(identityCard != null)
  121. map['IdentityCard'] = identityCard;
  122. if(licenseCard != null)
  123. map['LicenseCard'] = licenseCard;
  124. if(fieldList != null)
  125. map['FieldList'] = fieldList;
  126. return map;
  127. }
  128. }