Browse Source

同步Server最新接口

loki.wu 2 years ago
parent
commit
445b2d6669

+ 3 - 0
lib/rpc.dart

@@ -65,6 +65,9 @@ class JsonRpcProxy {
 	EmailService get email =>
 	findService(() => new EmailService(currentHostAddress));
 
+	FileTransferService get fileTransfer =>
+	findService(() => new FileTransferService(currentHostAddress));
+
 	IdentityApplyService get identityApply =>
 	findService(() => new IdentityApplyService(currentHostAddress));
 

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

@@ -199,8 +199,8 @@ enum CustomerRpcCode {
 	FileUrlError,
 	FileRequestParamError,
 	FileMultiPartParamError,
-	placeHolder_22,
-	placeHolder_23,
+	FileAbsolutePathError,
+	DownloadFileListError,
 	placeHolder_24,
 	placeHolder_25,
 	placeHolder_26,

+ 45 - 0
lib/services/fileTransfer.dart

@@ -0,0 +1,45 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
+
+import 'fileTransfer.m.dart';
+
+
+class FileTransferService extends JsonRpcClientBase {
+	FileTransferService(
+		String host, {
+		String serviceName = "IFileTransferService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => FileTransferRecorderDTO.fromJson(map));
+		FJsonConvert.setDecoder((map) => DownloadFileResult.fromJson(map));
+	}
+
+	Future<FileTransferRecorderDTO> fileTransferAsync(FileTransferRequest request) async {
+		var rpcRst = await call("FileTransferAsync", request);
+		var result = FileTransferRecorderDTO.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<FileTransferRecorderDTO> fileTransferAgainAsync(FileTransferAgainRequest request) async {
+		var rpcRst = await call("FileTransferAgainAsync", request);
+		var result = FileTransferRecorderDTO.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<DownloadFileResult> downloadFileAsync(DownloadFileRequest request) async {
+		var rpcRst = await call("DownloadFileAsync", request);
+		var result = DownloadFileResult.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+}
+

+ 284 - 0
lib/services/fileTransfer.m.dart

@@ -0,0 +1,284 @@
+class FileTransferRecorderDetailDTO {
+	int partNumber;
+	String? partFileName;
+	int partFileSize;
+	bool isUploadComplete;
+
+	FileTransferRecorderDetailDTO({
+		this.partNumber = 0,
+		this.partFileName,
+		this.partFileSize = 0,
+		this.isUploadComplete = false,
+	});
+
+	factory FileTransferRecorderDetailDTO.fromJson(Map<String, dynamic> map) {
+		return FileTransferRecorderDetailDTO( 
+			partNumber: map['PartNumber'],
+			partFileName: map['PartFileName'],
+			partFileSize: map['PartFileSize'],
+			isUploadComplete: map['IsUploadComplete'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['PartNumber'] = partNumber;
+		if(partFileName != null)
+			map['PartFileName'] = partFileName;
+		map['PartFileSize'] = partFileSize;
+		map['IsUploadComplete'] = isUploadComplete;
+		return map;
+	}
+}
+
+class FileTransferRecorderDTO {
+	String? filePath;
+	String? fileName;
+	String? host;
+	int fileSize;
+	bool isUploadComplete;
+	String? objectName;
+	bool isCopy;
+	List<FileTransferRecorderDetailDTO >? partList;
+
+	FileTransferRecorderDTO({
+		this.filePath,
+		this.fileName,
+		this.host,
+		this.fileSize = 0,
+		this.isUploadComplete = false,
+		this.objectName,
+		this.isCopy = false,
+		this.partList,
+	});
+
+	factory FileTransferRecorderDTO.fromJson(Map<String, dynamic> map) {
+		return FileTransferRecorderDTO( 
+			filePath: map['FilePath'],
+			fileName: map['FileName'],
+			host: map['Host'],
+			fileSize: map['FileSize'],
+			isUploadComplete: map['IsUploadComplete'],
+			objectName: map['ObjectName'],
+			isCopy: map['IsCopy'],
+			partList: map['PartList'] != null ? (map['PartList'] as List).map((e)=>FileTransferRecorderDetailDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(filePath != null)
+			map['FilePath'] = filePath;
+		if(fileName != null)
+			map['FileName'] = fileName;
+		if(host != null)
+			map['Host'] = host;
+		map['FileSize'] = fileSize;
+		map['IsUploadComplete'] = isUploadComplete;
+		if(objectName != null)
+			map['ObjectName'] = objectName;
+		map['IsCopy'] = isCopy;
+		if(partList != null)
+			map['PartList'] = partList;
+		return map;
+	}
+}
+
+class FileTransferRequest {
+	String? filePath;
+	String? fileName;
+	int divisionForUpload;
+	int sliceSizeForUpload;
+	bool isRechristen;
+	bool isCopy;
+
+	FileTransferRequest({
+		this.filePath,
+		this.fileName,
+		this.divisionForUpload = 0,
+		this.sliceSizeForUpload = 0,
+		this.isRechristen = false,
+		this.isCopy = false,
+	});
+
+	factory FileTransferRequest.fromJson(Map<String, dynamic> map) {
+		return FileTransferRequest( 
+			filePath: map['FilePath'],
+			fileName: map['FileName'],
+			divisionForUpload: map['DivisionForUpload'],
+			sliceSizeForUpload: map['SliceSizeForUpload'],
+			isRechristen: map['IsRechristen'],
+			isCopy: map['IsCopy'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(filePath != null)
+			map['FilePath'] = filePath;
+		if(fileName != null)
+			map['FileName'] = fileName;
+		map['DivisionForUpload'] = divisionForUpload;
+		map['SliceSizeForUpload'] = sliceSizeForUpload;
+		map['IsRechristen'] = isRechristen;
+		map['IsCopy'] = isCopy;
+		return map;
+	}
+}
+
+class FileTransferAgainRequest {
+	String? filePath;
+	String? host;
+	bool isCopy;
+	List<FileTransferRecorderDetailDTO >? partList;
+
+	FileTransferAgainRequest({
+		this.filePath,
+		this.host,
+		this.isCopy = false,
+		this.partList,
+	});
+
+	factory FileTransferAgainRequest.fromJson(Map<String, dynamic> map) {
+		return FileTransferAgainRequest( 
+			filePath: map['FilePath'],
+			host: map['Host'],
+			isCopy: map['IsCopy'],
+			partList: map['PartList'] != null ? (map['PartList'] as List).map((e)=>FileTransferRecorderDetailDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(filePath != null)
+			map['FilePath'] = filePath;
+		if(host != null)
+			map['Host'] = host;
+		map['IsCopy'] = isCopy;
+		if(partList != null)
+			map['PartList'] = partList;
+		return map;
+	}
+}
+
+class MarshalByRefObject {
+
+	MarshalByRefObject();
+
+	factory MarshalByRefObject.fromJson(Map<String, dynamic> map) {
+		return MarshalByRefObject( 
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		return map;
+	}
+}
+
+class Stream extends MarshalByRefObject{
+	bool canRead;
+	bool canWrite;
+	bool canSeek;
+	bool canTimeout;
+	int length;
+	int position;
+	int readTimeout;
+	int writeTimeout;
+
+	Stream({
+		this.canRead = false,
+		this.canWrite = false,
+		this.canSeek = false,
+		this.canTimeout = false,
+		this.length = 0,
+		this.position = 0,
+		this.readTimeout = 0,
+		this.writeTimeout = 0,
+	}) : super(
+		);
+
+	factory Stream.fromJson(Map<String, dynamic> map) {
+		return Stream( 
+			canRead: map['CanRead'],
+			canWrite: map['CanWrite'],
+			canSeek: map['CanSeek'],
+			canTimeout: map['CanTimeout'],
+			length: map['Length'],
+			position: map['Position'],
+			readTimeout: map['ReadTimeout'],
+			writeTimeout: map['WriteTimeout'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		map['CanRead'] = canRead;
+		map['CanWrite'] = canWrite;
+		map['CanSeek'] = canSeek;
+		map['CanTimeout'] = canTimeout;
+		map['Length'] = length;
+		map['Position'] = position;
+		map['ReadTimeout'] = readTimeout;
+		map['WriteTimeout'] = writeTimeout;
+		return map;
+	}
+}
+
+class DownloadFileResult {
+	Stream? merageFileStream;
+	int fileSize;
+
+	DownloadFileResult({
+		this.merageFileStream,
+		this.fileSize = 0,
+	});
+
+	factory DownloadFileResult.fromJson(Map<String, dynamic> map) {
+		return DownloadFileResult( 
+			merageFileStream: map['MerageFileStream'] != null ? Stream.fromJson(map['MerageFileStream']) : null,
+			fileSize: map['FileSize'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(merageFileStream != null)
+			map['MerageFileStream'] = merageFileStream;
+		map['FileSize'] = fileSize;
+		return map;
+	}
+}
+
+class DownloadFileRequest {
+	String? fileName;
+	String? host;
+	List<FileTransferRecorderDetailDTO >? downloadFileList;
+
+	DownloadFileRequest({
+		this.fileName,
+		this.host,
+		this.downloadFileList,
+	});
+
+	factory DownloadFileRequest.fromJson(Map<String, dynamic> map) {
+		return DownloadFileRequest( 
+			fileName: map['FileName'],
+			host: map['Host'],
+			downloadFileList: map['DownloadFileList'] != null ? (map['DownloadFileList'] as List).map((e)=>FileTransferRecorderDetailDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(fileName != null)
+			map['FileName'] = fileName;
+		if(host != null)
+			map['Host'] = host;
+		if(downloadFileList != null)
+			map['DownloadFileList'] = downloadFileList;
+		return map;
+	}
+}
+
+

+ 2 - 0
lib/services/index.dart

@@ -4,6 +4,7 @@ export 'connect.dart';
 export 'dBLog.dart';
 export 'device.dart';
 export 'email.dart';
+export 'fileTransfer.dart';
 export 'identityApply.dart';
 export 'login.dart';
 export 'notification.dart';
@@ -26,6 +27,7 @@ export 'authentication.m.dart';
 export 'connect.m.dart';
 export 'dBLog.m.dart';
 export 'device.m.dart';
+export 'fileTransfer.m.dart';
 export 'identityApply.m.dart';
 export 'login.m.dart';
 export 'notification.m.dart';

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

@@ -126,6 +126,7 @@ class QueryRecordResult {
 	String? deptName;
 	String? patientName;
 	String? patientAge;
+	List<DataItemDTO >? patientAgeInfo;
 	int patientSex;
 	String? creatorName;
 	String? deviceName;
@@ -139,6 +140,7 @@ class QueryRecordResult {
 		this.deptName,
 		this.patientName,
 		this.patientAge,
+		this.patientAgeInfo,
 		this.patientSex = 0,
 		this.creatorName,
 		this.deviceName,
@@ -154,6 +156,7 @@ class QueryRecordResult {
 			deptName: map['DeptName'],
 			patientName: map['PatientName'],
 			patientAge: map['PatientAge'],
+			patientAgeInfo: map['PatientAgeInfo'] != null ? (map['PatientAgeInfo'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
 			patientSex: map['PatientSex'],
 			creatorName: map['CreatorName'],
 			deviceName: map['DeviceName'],
@@ -174,6 +177,8 @@ class QueryRecordResult {
 			map['PatientName'] = patientName;
 		if(patientAge != null)
 			map['PatientAge'] = patientAge;
+		if(patientAgeInfo != null)
+			map['PatientAgeInfo'] = patientAgeInfo;
 		map['PatientSex'] = patientSex;
 		if(creatorName != null)
 			map['CreatorName'] = creatorName;

+ 10 - 0
lib/services/remedical.m.dart

@@ -433,6 +433,7 @@ class QueryExamListItemResult {
 	String? examCode;
 	String? patientName;
 	String? age;
+	List<DataItemDTO >? ageInfo;
 	String? sex;
 	List<String >? associatedExamCodes;
 
@@ -440,6 +441,7 @@ class QueryExamListItemResult {
 		this.examCode,
 		this.patientName,
 		this.age,
+		this.ageInfo,
 		this.sex,
 		this.associatedExamCodes,
 	});
@@ -449,6 +451,7 @@ class QueryExamListItemResult {
 			examCode: map['ExamCode'],
 			patientName: map['PatientName'],
 			age: map['Age'],
+			ageInfo: map['AgeInfo'] != null ? (map['AgeInfo'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
 			sex: map['Sex'],
 			associatedExamCodes: map['AssociatedExamCodes'] != null ? map['AssociatedExamCodes'].cast<String>().toList() : null,
 		);
@@ -462,6 +465,8 @@ class QueryExamListItemResult {
 			map['PatientName'] = patientName;
 		if(age != null)
 			map['Age'] = age;
+		if(ageInfo != null)
+			map['AgeInfo'] = ageInfo;
 		if(sex != null)
 			map['Sex'] = sex;
 		if(associatedExamCodes != null)
@@ -525,6 +530,7 @@ class QueryExamInfoResult {
 	String? deptName;
 	String? patientName;
 	String? patientAge;
+	List<DataItemDTO >? patientAgeInfo;
 	String? patientSex;
 	List<PatientInfoExt >? patientInfoExtList;
 	List<String >? associatedExamCodes;
@@ -535,6 +541,7 @@ class QueryExamInfoResult {
 		this.deptName,
 		this.patientName,
 		this.patientAge,
+		this.patientAgeInfo,
 		this.patientSex,
 		this.patientInfoExtList,
 		this.associatedExamCodes,
@@ -547,6 +554,7 @@ class QueryExamInfoResult {
 			deptName: map['DeptName'],
 			patientName: map['PatientName'],
 			patientAge: map['PatientAge'],
+			patientAgeInfo: map['PatientAgeInfo'] != null ? (map['PatientAgeInfo'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
 			patientSex: map['PatientSex'],
 			patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
 			associatedExamCodes: map['AssociatedExamCodes'] != null ? map['AssociatedExamCodes'].cast<String>().toList() : null,
@@ -564,6 +572,8 @@ class QueryExamInfoResult {
 			map['PatientName'] = patientName;
 		if(patientAge != null)
 			map['PatientAge'] = patientAge;
+		if(patientAgeInfo != null)
+			map['PatientAgeInfo'] = patientAgeInfo;
 		if(patientSex != null)
 			map['PatientSex'] = patientSex;
 		if(patientInfoExtList != null)