12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- enum ApplyStateEnum {
- Applying,
- Refused,
- Passed,
- }
- class IdentityApplyInfo {
- String? identityApplyCode;
- String? userCode;
- String? realName;
- String? emailAddress;
- String? organizationCode;
- String? departmentCode;
- String? applyPosition;
- List<String>? identityCard;
- List<String>? licenseCard;
- ApplyStateEnum applyState;
- String? applyNote;
- IdentityApplyInfo({
- this.identityApplyCode,
- this.userCode,
- this.realName,
- this.emailAddress,
- this.organizationCode,
- this.departmentCode,
- this.applyPosition,
- this.identityCard,
- this.licenseCard,
- this.applyState=ApplyStateEnum.Applying,
- this.applyNote,
- });
- factory IdentityApplyInfo.fromJson(Map<String, dynamic> map) {
- final identityCardData = map['IdentityCard'];
- final licenseCardData = map['LicenseCard'];
- return IdentityApplyInfo(
- identityApplyCode: map['IdentityApplyCode'],
- userCode: map['UserCode'],
- realName: map['RealName'],
- emailAddress: map['EmailAddress'],
- organizationCode: map['OrganizationCode'],
- departmentCode: map['DepartmentCode'],
- applyPosition: map['ApplyPosition'],
- identityCard: identityCardData != null ? (identityCardData as List).map((e) => e as String).toList(): const [],
- licenseCard: licenseCardData != null ? (licenseCardData as List).map((e) => e as String).toList(): const [],
- applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
- applyNote: map['ApplyNote'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(identityApplyCode != null)
- map['IdentityApplyCode'] = identityApplyCode;
- if(userCode != null)
- map['UserCode'] = userCode;
- if(realName != null)
- map['RealName'] = realName;
- if(emailAddress != null)
- map['EmailAddress'] = emailAddress;
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if(departmentCode != null)
- map['DepartmentCode'] = departmentCode;
- if(applyPosition != null)
- map['ApplyPosition'] = applyPosition;
- if(identityCard != null)
- map['IdentityCard'] = identityCard;
- if(licenseCard != null)
- map['LicenseCard'] = licenseCard;
- map['ApplyState'] = applyState.index;
- if(applyNote != null)
- map['ApplyNote'] = applyNote;
- return map;
- }
- }
|