Browse Source

dll ver - 1.04.1 & remove storage service

melon.yin 3 years ago
parent
commit
e8b053dfd2

+ 30 - 36
lib/rpc.dart

@@ -49,56 +49,51 @@ class JsonRpcProxy {
     return _platformService!;
   }
 
-	AuthenticationService get authentication =>
-	findService(() => new AuthenticationService(currentHostAddress));
+  AuthenticationService get authentication =>
+      findService(() => new AuthenticationService(currentHostAddress));
 
-	ClientLogService get clientLog =>
-	findService(() => new ClientLogService(currentHostAddress));
+  ClientLogService get clientLog =>
+      findService(() => new ClientLogService(currentHostAddress));
 
-	DeviceService get device =>
-	findService(() => new DeviceService(currentHostAddress));
+  DeviceService get device =>
+      findService(() => new DeviceService(currentHostAddress));
 
-	EmailService get email =>
-	findService(() => new EmailService(currentHostAddress));
+  EmailService get email =>
+      findService(() => new EmailService(currentHostAddress));
 
-	IdentityApplyService get identityApply =>
-	findService(() => new IdentityApplyService(currentHostAddress));
+  IdentityApplyService get identityApply =>
+      findService(() => new IdentityApplyService(currentHostAddress));
 
-	LoginService get login =>
-	findService(() => new LoginService(currentHostAddress));
+  LoginService get login =>
+      findService(() => new LoginService(currentHostAddress));
 
-	OrganizationService get organization =>
-	findService(() => new OrganizationService(currentHostAddress));
+  OrganizationService get organization =>
+      findService(() => new OrganizationService(currentHostAddress));
 
-	PatientService get patient =>
-	findService(() => new PatientService(currentHostAddress));
+  PatientService get patient =>
+      findService(() => new PatientService(currentHostAddress));
 
-	PositionService get position =>
-	findService(() => new PositionService(currentHostAddress));
+  PositionService get position =>
+      findService(() => new PositionService(currentHostAddress));
 
-	RankService get rank =>
-	findService(() => new RankService(currentHostAddress));
+  RankService get rank =>
+      findService(() => new RankService(currentHostAddress));
 
-	RegionService get region =>
-	findService(() => new RegionService(currentHostAddress));
+  RegionService get region =>
+      findService(() => new RegionService(currentHostAddress));
 
-	RemedicalService get remedical =>
-	findService(() => new RemedicalService(currentHostAddress));
+  RemedicalService get remedical =>
+      findService(() => new RemedicalService(currentHostAddress));
 
-	RoleService get role =>
-	findService(() => new RoleService(currentHostAddress));
+  RoleService get role =>
+      findService(() => new RoleService(currentHostAddress));
 
-	SMSService get sMS =>
-	findService(() => new SMSService(currentHostAddress));
+  SMSService get sMS => findService(() => new SMSService(currentHostAddress));
 
-	StorageService get storage =>
-	findService(() => new StorageService(currentHostAddress));
+  UserService get user =>
+      findService(() => new UserService(currentHostAddress));
 
-	UserService get user =>
-	findService(() => new UserService(currentHostAddress));
-
-
-    /* 服务代理设置 End */
+  /* 服务代理设置 End */
 
   /// 设置服务主机地址
   void setServerHost(String address) {
@@ -120,4 +115,3 @@ class JsonRpcProxy {
     return _serviceCache[serviceType] as T;
   }
 }
-

+ 3 - 3
lib/services/authentication.dart

@@ -19,13 +19,13 @@ class AuthenticationService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => StorageAuthenticationInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => StorageAuthenticationInfoDTO.fromJson(map));
 		FJsonConvert.setDecoder((map) => TokenInfo.fromJson(map));
 	}
 
-	Future<StorageAuthenticationInfo> getAuthorizationAsync(AuthenticationRequest request) async {
+	Future<StorageAuthenticationInfoDTO> getAuthorizationAsync(AuthenticationRequest request) async {
 		var rpcRst = await call("GetAuthorizationAsync", request);
-		var result = StorageAuthenticationInfo.fromJson(rpcRst as Map<String, dynamic>);
+		var result = StorageAuthenticationInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 

+ 8 - 8
lib/services/authentication.m.dart

@@ -1,11 +1,11 @@
-class StorageAuthenticationInfo {
+class StorageAuthenticationInfoDTO {
 	String? authorization;
 	String? fileToken;
 	String? contentType;
 	String? storageUrl;
 	String? fileInfo;
 
-	StorageAuthenticationInfo({
+	StorageAuthenticationInfoDTO({
 		this.authorization,
 		this.fileToken,
 		this.contentType,
@@ -13,8 +13,8 @@ class StorageAuthenticationInfo {
 		this.fileInfo,
 	});
 
-	factory StorageAuthenticationInfo.fromJson(Map<String, dynamic> map) {
-		return StorageAuthenticationInfo( 
+	factory StorageAuthenticationInfoDTO.fromJson(Map<String, dynamic> map) {
+		return StorageAuthenticationInfoDTO( 
 			authorization: map['Authorization'],
 			fileToken: map['FileToken'],
 			contentType: map['ContentType'],
@@ -76,7 +76,7 @@ class TokenRequest extends BaseRequest{
 	}
 }
 
-enum UploadFileType {
+enum UploadFileTypeEnum {
 	Unknown,
 	EXE,
 	APK,
@@ -104,10 +104,10 @@ enum UploadFileType {
 }
 
 class AuthenticationRequest extends TokenRequest{
-	UploadFileType fileTypeEnum;
+	UploadFileTypeEnum fileTypeEnum;
 
 	AuthenticationRequest({
-		this.fileTypeEnum = UploadFileType.Unknown,
+		this.fileTypeEnum = UploadFileTypeEnum.Unknown,
 		String? token,
 	}) : super(
 			token: token,
@@ -115,7 +115,7 @@ class AuthenticationRequest extends TokenRequest{
 
 	factory AuthenticationRequest.fromJson(Map<String, dynamic> map) {
 		return AuthenticationRequest( 
-			fileTypeEnum: UploadFileType.values.firstWhere((e) => e.index == map['FileTypeEnum']),
+			fileTypeEnum: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FileTypeEnum']),
 			token: map['Token'],
 		);
 	}

+ 0 - 1
lib/services/index.dart

@@ -13,7 +13,6 @@ export 'region.dart';
 export 'remedical.dart';
 export 'role.dart';
 export 'sMS.dart';
-export 'storage.dart';
 export 'user.dart';
 export 'authentication.m.dart';
 export 'device.m.dart';

+ 5 - 0
lib/services/organization.m.dart

@@ -98,6 +98,7 @@ class OrganizationDTO extends OrganizationBasicDTO{
 	String? nautica;
 	OrganizationStateEnum state;
 	List<String>? directors;
+	List<String>? assignedAdmins;
 
 	OrganizationDTO({
 		this.description,
@@ -107,6 +108,7 @@ class OrganizationDTO extends OrganizationBasicDTO{
 		this.nautica,
 		this.state = OrganizationStateEnum.WaitAudit,
 		this.directors,
+		this.assignedAdmins,
 		String? regionCode,
 		String? parentCode,
 		String? logoUrl,
@@ -133,6 +135,7 @@ class OrganizationDTO extends OrganizationBasicDTO{
 			nautica: map['Nautica'],
 			state: OrganizationStateEnum.values.firstWhere((e) => e.index == map['State']),
 			directors: map['Directors'] != null ? map['Directors'].cast<String>().toList() : null,
+			assignedAdmins: map['AssignedAdmins'] != null ? map['AssignedAdmins'].cast<String>().toList() : null,
 			regionCode: map['RegionCode'],
 			parentCode: map['ParentCode'],
 			logoUrl: map['LogoUrl'],
@@ -157,6 +160,8 @@ class OrganizationDTO extends OrganizationBasicDTO{
 		map['State'] = state.index;
 		if(directors != null)
 			map['Directors'] = directors;
+		if(assignedAdmins != null)
+			map['AssignedAdmins'] = assignedAdmins;
 		return map;
 	}
 }

+ 6 - 0
lib/services/patient.dart

@@ -57,5 +57,11 @@ class PatientService extends JsonRpcClientBase {
 		return result;
 	}
 
+	Future<List<PatientInfoBaseDTO>> findValidPatientsByName(FindValidPatientsByNameRequest request) async {
+		var rpcRst = await call("FindValidPatientsByName", request);
+		var result = (rpcRst as List).map((e)=>PatientInfoBaseDTO.fromJson(e as Map<String, dynamic>)).toList();
+		return result;
+	}
+
 }
 

+ 35 - 0
lib/services/patient.m.dart

@@ -409,9 +409,11 @@ class FindPatientsPageRequest extends PageRequest{
 
 class PatientInfoDTO extends PatientInfoBaseDTO{
 	List<String>? recordCodes;
+	String? creatorCode;
 
 	PatientInfoDTO({
 		this.recordCodes,
+		this.creatorCode,
 		String? patientCode,
 		String? name,
 		String? phone,
@@ -442,6 +444,7 @@ class PatientInfoDTO extends PatientInfoBaseDTO{
 	factory PatientInfoDTO.fromJson(Map<String, dynamic> map) {
 		return PatientInfoDTO( 
 			recordCodes: map['RecordCodes'] != null ? map['RecordCodes'].cast<String>().toList() : null,
+			creatorCode: map['CreatorCode'],
 			patientCode: map['PatientCode'],
 			name: map['Name'],
 			phone: map['Phone'],
@@ -461,6 +464,8 @@ class PatientInfoDTO extends PatientInfoBaseDTO{
 		final map = super.toJson();
 		if(recordCodes != null)
 			map['RecordCodes'] = recordCodes;
+		if(creatorCode != null)
+			map['CreatorCode'] = creatorCode;
 		return map;
 	}
 }
@@ -520,4 +525,34 @@ class AssignPatientToUsersRequest extends TokenRequest{
 	}
 }
 
+class FindValidPatientsByNameRequest extends TokenRequest{
+	String? name;
+	String? userCode;
+
+	FindValidPatientsByNameRequest({
+		this.name,
+		this.userCode,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory FindValidPatientsByNameRequest.fromJson(Map<String, dynamic> map) {
+		return FindValidPatientsByNameRequest( 
+			name: map['Name'],
+			userCode: map['UserCode'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(name != null)
+			map['Name'] = name;
+		if(userCode != null)
+			map['UserCode'] = userCode;
+		return map;
+	}
+}
+
 

+ 8 - 0
lib/services/user.dart

@@ -5,6 +5,7 @@ import 'package:fis_common/json_convert.dart';
 
 import 'user.m.dart';
 
+import 'authentication.m.dart';
 import 'patient.m.dart';
 
 
@@ -24,6 +25,7 @@ class UserService extends JsonRpcClientBase {
 		FJsonConvert.setDecoder((map) => UserDTO.fromJson(map));
 		FJsonConvert.setDecoder((map) => PageResult<ShareDeviceUserDTO>.fromJson(map));
 		FJsonConvert.setDecoder((map) => ShareDeviceUserDTO.fromJson(map));
+		FJsonConvert.setDecoder((map) => UserFeatureInfoDTO.fromJson(map));
 	}
 
 	Future<UserDTO> getUserInfoAsync(GetUserInfoRequest request) async {
@@ -64,5 +66,11 @@ class UserService extends JsonRpcClientBase {
 		return result;
 	}
 
+	Future<List<UserFeatureInfoDTO>> getUserFeatureListAsync(TokenRequest request) async {
+		var rpcRst = await call("GetUserFeatureListAsync", request);
+		var result = (rpcRst as List).map((e)=>UserFeatureInfoDTO.fromJson(e as Map<String, dynamic>)).toList();
+		return result;
+	}
+
 }
 

+ 78 - 0
lib/services/user.m.dart

@@ -509,4 +509,82 @@ class GetShareDeviceUsersPageRequest extends PageRequest{
 	}
 }
 
+class BaseFeatureInfoDTO extends BaseDTO{
+	String? featureCode;
+	String? featureName;
+	String? fatherCode;
+	String? uniqueCode;
+
+	BaseFeatureInfoDTO({
+		this.featureCode,
+		this.featureName,
+		this.fatherCode,
+		this.uniqueCode,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory BaseFeatureInfoDTO.fromJson(Map<String, dynamic> map) {
+		return BaseFeatureInfoDTO( 
+			featureCode: map['FeatureCode'],
+			featureName: map['FeatureName'],
+			fatherCode: map['FatherCode'],
+			uniqueCode: map['UniqueCode'],
+			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
+			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(featureCode != null)
+			map['FeatureCode'] = featureCode;
+		if(featureName != null)
+			map['FeatureName'] = featureName;
+		if(fatherCode != null)
+			map['FatherCode'] = fatherCode;
+		if(uniqueCode != null)
+			map['UniqueCode'] = uniqueCode;
+		return map;
+	}
+}
+
+class UserFeatureInfoDTO extends BaseFeatureInfoDTO{
+
+	UserFeatureInfoDTO({
+		String? featureCode,
+		String? featureName,
+		String? fatherCode,
+		String? uniqueCode,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			featureCode: featureCode,
+			featureName: featureName,
+			fatherCode: fatherCode,
+			uniqueCode: uniqueCode,
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory UserFeatureInfoDTO.fromJson(Map<String, dynamic> map) {
+		return UserFeatureInfoDTO( 
+			featureCode: map['FeatureCode'],
+			featureName: map['FeatureName'],
+			fatherCode: map['FatherCode'],
+			uniqueCode: map['UniqueCode'],
+			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
+			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		return map;
+	}
+}
+