Browse Source

sync last server interface

loki.wu 3 years ago
parent
commit
d517406d53

+ 6 - 0
lib/rpc.dart

@@ -55,6 +55,9 @@ class JsonRpcProxy {
 	ClientLogService get clientLog =>
 	findService(() => new ClientLogService(currentHostAddress));
 
+	ConnectService get connect =>
+	findService(() => new ConnectService(currentHostAddress));
+
 	DeviceService get device =>
 	findService(() => new DeviceService(currentHostAddress));
 
@@ -67,6 +70,9 @@ class JsonRpcProxy {
 	LoginService get login =>
 	findService(() => new LoginService(currentHostAddress));
 
+	NotificationService get notification =>
+	findService(() => new NotificationService(currentHostAddress));
+
 	OrganizationService get organization =>
 	findService(() => new OrganizationService(currentHostAddress));
 

+ 14 - 4
lib/services/authentication.dart

@@ -19,14 +19,13 @@ class AuthenticationService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => StorageAuthenticationInfoDTO.fromJson(map));
 		FJsonConvert.setDecoder((map) => TokenInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => AuthTokenDTO.fromJson(map));
 	}
 
-	Future<StorageAuthenticationInfoDTO> getAuthorizationAsync(AuthenticationRequest request) async {
+	Future<String> getAuthorizationAsync(AuthenticationRequest request) async {
 		var rpcRst = await call("GetAuthorizationAsync", request);
-		var result = StorageAuthenticationInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
-		return result;
+		return rpcRst;
 	}
 
 	Future<TokenInfo> createTokenAsync(CreateTokenRequest request) async {
@@ -51,5 +50,16 @@ class AuthenticationService extends JsonRpcClientBase {
 		return rpcRst;
 	}
 
+	Future<String> createAuthToken(CreateAuthTokenRequest request) async {
+		var rpcRst = await call("CreateAuthToken", request);
+		return rpcRst;
+	}
+
+	Future<AuthTokenDTO> getAuthToken(TokenRequest request) async {
+		var rpcRst = await call("GetAuthToken", request);
+		var result = AuthTokenDTO.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
 }
 

+ 79 - 71
lib/services/authentication.m.dart

@@ -1,43 +1,4 @@
-class StorageAuthenticationInfoDTO {
-	String? authorization;
-	String? fileToken;
-	String? contentType;
-	String? storageUrl;
-	String? fileInfo;
-
-	StorageAuthenticationInfoDTO({
-		this.authorization,
-		this.fileToken,
-		this.contentType,
-		this.storageUrl,
-		this.fileInfo,
-	});
-
-	factory StorageAuthenticationInfoDTO.fromJson(Map<String, dynamic> map) {
-		return StorageAuthenticationInfoDTO( 
-			authorization: map['Authorization'],
-			fileToken: map['FileToken'],
-			contentType: map['ContentType'],
-			storageUrl: map['StorageUrl'],
-			fileInfo: map['FileInfo'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(authorization != null)
-			map['Authorization'] = authorization;
-		if(fileToken != null)
-			map['FileToken'] = fileToken;
-		if(contentType != null)
-			map['ContentType'] = contentType;
-		if(storageUrl != null)
-			map['StorageUrl'] = storageUrl;
-		if(fileInfo != null)
-			map['FileInfo'] = fileInfo;
-		return map;
-	}
-}
+import 'package:fis_jsonrpc/utils.dart';
 
 class BaseRequest {
 
@@ -76,38 +37,11 @@ class TokenRequest extends BaseRequest{
 	}
 }
 
-enum UploadFileTypeEnum {
-	Unknown,
-	EXE,
-	APK,
-	IPA,
-	ZIP,
-	DAT,
-	RAR,
-	PNG,
-	ICON,
-	BMP,
-	JPEG,
-	JPG,
-	GIF,
-	WEBP,
-	TIFF,
-	IMG,
-	PDF,
-	DOC,
-	DOCX,
-	XLS,
-	XLSX,
-	MP4,
-	MSI,
-	VID,
-}
-
 class AuthenticationRequest extends TokenRequest{
-	UploadFileTypeEnum fileTypeEnum;
+	String? fileName;
 
 	AuthenticationRequest({
-		this.fileTypeEnum = UploadFileTypeEnum.Unknown,
+		this.fileName,
 		String? token,
 	}) : super(
 			token: token,
@@ -115,14 +49,15 @@ class AuthenticationRequest extends TokenRequest{
 
 	factory AuthenticationRequest.fromJson(Map<String, dynamic> map) {
 		return AuthenticationRequest( 
-			fileTypeEnum: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FileTypeEnum']),
+			fileName: map['FileName'],
 			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		map['FileTypeEnum'] = fileTypeEnum.index;
+		if(fileName != null)
+			map['FileName'] = fileName;
 		return map;
 	}
 }
@@ -210,4 +145,77 @@ class CreateTokenRequest {
 	}
 }
 
+class AuthTokenDTO {
+	String? code;
+	DateTime? issueTime;
+	DateTime? expiryTime;
+	String? sourceUrl;
+	Map<String,String>? claims;
+
+	AuthTokenDTO({
+		this.code,
+		this.issueTime,
+		this.expiryTime,
+		this.sourceUrl,
+		this.claims,
+	});
+
+	factory AuthTokenDTO.fromJson(Map<String, dynamic> map) {
+		return AuthTokenDTO( 
+			code: map['Code'],
+			issueTime: map['IssueTime'] != null ? DateTime.parse(map['IssueTime']) : null,
+			expiryTime: map['ExpiryTime'] != null ? DateTime.parse(map['ExpiryTime']) : null,
+			sourceUrl: map['SourceUrl'],
+			claims: map['Claims'] != null ? map['Claims'].cast<String,String>() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(code != null)
+			map['Code'] = code;
+		if(issueTime != null)
+			map['IssueTime'] = JsonRpcUtils.dateFormat(issueTime!);
+		if(expiryTime != null)
+			map['ExpiryTime'] = JsonRpcUtils.dateFormat(expiryTime!);
+		if(sourceUrl != null)
+			map['SourceUrl'] = sourceUrl;
+		if(claims != null)
+			map['Claims'] = claims;
+		return map;
+	}
+}
+
+class CreateAuthTokenRequest extends AuthTokenDTO{
+
+	CreateAuthTokenRequest({
+		String? code,
+		DateTime? issueTime,
+		DateTime? expiryTime,
+		String? sourceUrl,
+		Map<String,String>? claims,
+	}) : super(
+			code: code,
+			issueTime: issueTime,
+			expiryTime: expiryTime,
+			sourceUrl: sourceUrl,
+			claims: claims,
+		);
+
+	factory CreateAuthTokenRequest.fromJson(Map<String, dynamic> map) {
+		return CreateAuthTokenRequest( 
+			code: map['Code'],
+			issueTime: map['IssueTime'] != null ? DateTime.parse(map['IssueTime']) : null,
+			expiryTime: map['ExpiryTime'] != null ? DateTime.parse(map['ExpiryTime']) : null,
+			sourceUrl: map['SourceUrl'],
+			claims: map['Claims'] != null ? map['Claims'].cast<String,String>() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		return map;
+	}
+}
+
 

+ 32 - 0
lib/services/connect.dart

@@ -0,0 +1,32 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
+
+import 'connect.m.dart';
+
+
+class ConnectService extends JsonRpcClientBase {
+	ConnectService(
+		String host, {
+		String serviceName = "IConnectService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => ConnectResult.fromJson(map));
+	}
+
+	Future<ConnectResult> connect(ConnectRequest request) async {
+		var rpcRst = await call("Connect", request);
+		var result = ConnectResult.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+}
+

+ 98 - 0
lib/services/connect.m.dart

@@ -0,0 +1,98 @@
+class ConnectResult {
+	String? token;
+	String? uniqueCode;
+
+	ConnectResult({
+		this.token,
+		this.uniqueCode,
+	});
+
+	factory ConnectResult.fromJson(Map<String, dynamic> map) {
+		return ConnectResult( 
+			token: map['Token'],
+			uniqueCode: map['UniqueCode'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(token != null)
+			map['Token'] = token;
+		if(uniqueCode != null)
+			map['UniqueCode'] = uniqueCode;
+		return map;
+	}
+}
+
+class ConnectRequest {
+	String? deviceUniqueCode;
+	String? password;
+	String? deviceModel;
+	String? deviceType;
+	String? softwareVersion;
+	String? systemVersion;
+	String? cPUModel;
+	String? systemLanguage;
+	String? description;
+	String? name;
+	String? organizationCode;
+
+	ConnectRequest({
+		this.deviceUniqueCode,
+		this.password,
+		this.deviceModel,
+		this.deviceType,
+		this.softwareVersion,
+		this.systemVersion,
+		this.cPUModel,
+		this.systemLanguage,
+		this.description,
+		this.name,
+		this.organizationCode,
+	});
+
+	factory ConnectRequest.fromJson(Map<String, dynamic> map) {
+		return ConnectRequest( 
+			deviceUniqueCode: map['DeviceUniqueCode'],
+			password: map['Password'],
+			deviceModel: map['DeviceModel'],
+			deviceType: map['DeviceType'],
+			softwareVersion: map['SoftwareVersion'],
+			systemVersion: map['SystemVersion'],
+			cPUModel: map['CPUModel'],
+			systemLanguage: map['SystemLanguage'],
+			description: map['Description'],
+			name: map['Name'],
+			organizationCode: map['OrganizationCode'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(deviceUniqueCode != null)
+			map['DeviceUniqueCode'] = deviceUniqueCode;
+		if(password != null)
+			map['Password'] = password;
+		if(deviceModel != null)
+			map['DeviceModel'] = deviceModel;
+		if(deviceType != null)
+			map['DeviceType'] = deviceType;
+		if(softwareVersion != null)
+			map['SoftwareVersion'] = softwareVersion;
+		if(systemVersion != null)
+			map['SystemVersion'] = systemVersion;
+		if(cPUModel != null)
+			map['CPUModel'] = cPUModel;
+		if(systemLanguage != null)
+			map['SystemLanguage'] = systemLanguage;
+		if(description != null)
+			map['Description'] = description;
+		if(name != null)
+			map['Name'] = name;
+		if(organizationCode != null)
+			map['OrganizationCode'] = organizationCode;
+		return map;
+	}
+}
+
+

+ 6 - 0
lib/services/device.dart

@@ -106,5 +106,11 @@ class DeviceService extends JsonRpcClientBase {
 		return result;
 	}
 
+	Future<Map<String,String>> queryServerConfig(TokenRequest request) async {
+		var rpcRst = await call("QueryServerConfig", request);
+		var result = (rpcRst as Map).cast<String,String>();
+		return result;
+	}
+
 }
 

+ 48 - 20
lib/services/device.m.dart

@@ -33,30 +33,42 @@ class BaseDTO {
 class DeviceInfoDTO extends BaseDTO{
 	String? deviceCode;
 	String? serialNumber;
+	String? password;
 	String? name;
 	String? description;
 	String? deviceModel;
 	String? deviceType;
 	String? headPicUrl;
+	String? headPicUrlToken;
 	String? deviceSoftwareVersion;
 	String? sDKSoftwareVersion;
 	String? organizationCode;
 	String? shortCode;
 	bool isAutoShared;
+	DateTime? lastLoginTime;
+	String? systemVersion;
+	String? cPUModel;
+	String? systemLanguage;
 
 	DeviceInfoDTO({
 		this.deviceCode,
 		this.serialNumber,
+		this.password,
 		this.name,
 		this.description,
 		this.deviceModel,
 		this.deviceType,
 		this.headPicUrl,
+		this.headPicUrlToken,
 		this.deviceSoftwareVersion,
 		this.sDKSoftwareVersion,
 		this.organizationCode,
 		this.shortCode,
 		this.isAutoShared = false,
+		this.lastLoginTime,
+		this.systemVersion,
+		this.cPUModel,
+		this.systemLanguage,
 		DateTime? createTime,
 		DateTime? updateTime,
 	}) : super(
@@ -68,16 +80,22 @@ class DeviceInfoDTO extends BaseDTO{
 		return DeviceInfoDTO( 
 			deviceCode: map['DeviceCode'],
 			serialNumber: map['SerialNumber'],
+			password: map['Password'],
 			name: map['Name'],
 			description: map['Description'],
 			deviceModel: map['DeviceModel'],
 			deviceType: map['DeviceType'],
 			headPicUrl: map['HeadPicUrl'],
+			headPicUrlToken: map['HeadPicUrlToken'],
 			deviceSoftwareVersion: map['DeviceSoftwareVersion'],
 			sDKSoftwareVersion: map['SDKSoftwareVersion'],
 			organizationCode: map['OrganizationCode'],
 			shortCode: map['ShortCode'],
 			isAutoShared: map['IsAutoShared'],
+			lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
+			systemVersion: map['SystemVersion'],
+			cPUModel: map['CPUModel'],
+			systemLanguage: map['SystemLanguage'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
 			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
 		);
@@ -89,6 +107,8 @@ class DeviceInfoDTO extends BaseDTO{
 			map['DeviceCode'] = deviceCode;
 		if(serialNumber != null)
 			map['SerialNumber'] = serialNumber;
+		if(password != null)
+			map['Password'] = password;
 		if(name != null)
 			map['Name'] = name;
 		if(description != null)
@@ -99,6 +119,8 @@ class DeviceInfoDTO extends BaseDTO{
 			map['DeviceType'] = deviceType;
 		if(headPicUrl != null)
 			map['HeadPicUrl'] = headPicUrl;
+		if(headPicUrlToken != null)
+			map['HeadPicUrlToken'] = headPicUrlToken;
 		if(deviceSoftwareVersion != null)
 			map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
 		if(sDKSoftwareVersion != null)
@@ -108,6 +130,14 @@ class DeviceInfoDTO extends BaseDTO{
 		if(shortCode != null)
 			map['ShortCode'] = shortCode;
 		map['IsAutoShared'] = isAutoShared;
+		if(lastLoginTime != null)
+			map['LastLoginTime'] = JsonRpcUtils.dateFormat(lastLoginTime!);
+		if(systemVersion != null)
+			map['SystemVersion'] = systemVersion;
+		if(cPUModel != null)
+			map['CPUModel'] = cPUModel;
+		if(systemLanguage != null)
+			map['SystemLanguage'] = systemLanguage;
 		return map;
 	}
 }
@@ -299,8 +329,6 @@ class BindDeviceRequest extends TokenRequest{
 	String? serialNumber;
 	String? name;
 	String? description;
-	String? deviceModel;
-	String? deviceType;
 	String? headPicUrl;
 	String? organizationCode;
 	String? shortCode;
@@ -310,8 +338,6 @@ class BindDeviceRequest extends TokenRequest{
 		this.serialNumber,
 		this.name,
 		this.description,
-		this.deviceModel,
-		this.deviceType,
 		this.headPicUrl,
 		this.organizationCode,
 		this.shortCode,
@@ -326,8 +352,6 @@ class BindDeviceRequest extends TokenRequest{
 			serialNumber: map['SerialNumber'],
 			name: map['Name'],
 			description: map['Description'],
-			deviceModel: map['DeviceModel'],
-			deviceType: map['DeviceType'],
 			headPicUrl: map['HeadPicUrl'],
 			organizationCode: map['OrganizationCode'],
 			shortCode: map['ShortCode'],
@@ -344,10 +368,6 @@ class BindDeviceRequest extends TokenRequest{
 			map['Name'] = name;
 		if(description != null)
 			map['Description'] = description;
-		if(deviceModel != null)
-			map['DeviceModel'] = deviceModel;
-		if(deviceType != null)
-			map['DeviceType'] = deviceType;
 		if(headPicUrl != null)
 			map['HeadPicUrl'] = headPicUrl;
 		if(organizationCode != null)
@@ -364,8 +384,6 @@ class AlterDeviceRequest extends TokenRequest{
 	String? serialNumber;
 	String? name;
 	String? description;
-	String? deviceModel;
-	String? deviceType;
 	String? headPicUrl;
 	String? organizationCode;
 	bool isAutoShared;
@@ -375,8 +393,6 @@ class AlterDeviceRequest extends TokenRequest{
 		this.serialNumber,
 		this.name,
 		this.description,
-		this.deviceModel,
-		this.deviceType,
 		this.headPicUrl,
 		this.organizationCode,
 		this.isAutoShared = false,
@@ -391,8 +407,6 @@ class AlterDeviceRequest extends TokenRequest{
 			serialNumber: map['SerialNumber'],
 			name: map['Name'],
 			description: map['Description'],
-			deviceModel: map['DeviceModel'],
-			deviceType: map['DeviceType'],
 			headPicUrl: map['HeadPicUrl'],
 			organizationCode: map['OrganizationCode'],
 			isAutoShared: map['IsAutoShared'],
@@ -410,10 +424,6 @@ class AlterDeviceRequest extends TokenRequest{
 			map['Name'] = name;
 		if(description != null)
 			map['Description'] = description;
-		if(deviceModel != null)
-			map['DeviceModel'] = deviceModel;
-		if(deviceType != null)
-			map['DeviceType'] = deviceType;
 		if(headPicUrl != null)
 			map['HeadPicUrl'] = headPicUrl;
 		if(organizationCode != null)
@@ -658,31 +668,43 @@ class DeviceExtendInfoDTO extends DeviceInfoDTO{
 		this.isOnline = false,
 		String? deviceCode,
 		String? serialNumber,
+		String? password,
 		String? name,
 		String? description,
 		String? deviceModel,
 		String? deviceType,
 		String? headPicUrl,
+		String? headPicUrlToken,
 		String? deviceSoftwareVersion,
 		String? sDKSoftwareVersion,
 		String? organizationCode,
 		String? shortCode,
 		bool isAutoShared = false,
+		DateTime? lastLoginTime,
+		String? systemVersion,
+		String? cPUModel,
+		String? systemLanguage,
 		DateTime? createTime,
 		DateTime? updateTime,
 	}) : super(
 			deviceCode: deviceCode,
 			serialNumber: serialNumber,
+			password: password,
 			name: name,
 			description: description,
 			deviceModel: deviceModel,
 			deviceType: deviceType,
 			headPicUrl: headPicUrl,
+			headPicUrlToken: headPicUrlToken,
 			deviceSoftwareVersion: deviceSoftwareVersion,
 			sDKSoftwareVersion: sDKSoftwareVersion,
 			organizationCode: organizationCode,
 			shortCode: shortCode,
 			isAutoShared: isAutoShared,
+			lastLoginTime: lastLoginTime,
+			systemVersion: systemVersion,
+			cPUModel: cPUModel,
+			systemLanguage: systemLanguage,
 			createTime: createTime,
 			updateTime: updateTime,
 		);
@@ -693,16 +715,22 @@ class DeviceExtendInfoDTO extends DeviceInfoDTO{
 			isOnline: map['IsOnline'],
 			deviceCode: map['DeviceCode'],
 			serialNumber: map['SerialNumber'],
+			password: map['Password'],
 			name: map['Name'],
 			description: map['Description'],
 			deviceModel: map['DeviceModel'],
 			deviceType: map['DeviceType'],
 			headPicUrl: map['HeadPicUrl'],
+			headPicUrlToken: map['HeadPicUrlToken'],
 			deviceSoftwareVersion: map['DeviceSoftwareVersion'],
 			sDKSoftwareVersion: map['SDKSoftwareVersion'],
 			organizationCode: map['OrganizationCode'],
 			shortCode: map['ShortCode'],
 			isAutoShared: map['IsAutoShared'],
+			lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
+			systemVersion: map['SystemVersion'],
+			cPUModel: map['CPUModel'],
+			systemLanguage: map['SystemLanguage'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
 			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
 		);

+ 27 - 28
lib/services/identityApply.m.dart

@@ -14,6 +14,8 @@ class IdentityApplyDTO extends BaseDTO{
 	String? applyRoleCode;
 	List<String>? identityCard;
 	List<String>? licenseCard;
+	List<String>? licenseCardToken;
+	List<String>? identityCardToken;
 	ApplyStateEnum applyState;
 	String? applyNote;
 
@@ -23,6 +25,8 @@ class IdentityApplyDTO extends BaseDTO{
 		this.applyRoleCode,
 		this.identityCard,
 		this.licenseCard,
+		this.licenseCardToken,
+		this.identityCardToken,
 		this.applyState = ApplyStateEnum.NotApply,
 		this.applyNote,
 		DateTime? createTime,
@@ -35,12 +39,16 @@ class IdentityApplyDTO extends BaseDTO{
 	factory IdentityApplyDTO.fromJson(Map<String, dynamic> map) {
 		final identityCardData = map['IdentityCard'];
 		final licenseCardData = map['LicenseCard'];
+		final licenseCardTokenData = map['LicenseCardToken'];
+		final identityCardTokenData = map['IdentityCardToken'];
 		return IdentityApplyDTO( 
 			identityApplyCode: map['IdentityApplyCode'],
 			userCode: map['UserCode'],
 			applyRoleCode: map['ApplyRoleCode'],
 			identityCard: identityCardData != null ? (identityCardData as List).map((e) => e as String).toList(): null,
 			licenseCard: licenseCardData != null ? (licenseCardData as List).map((e) => e as String).toList(): null,
+			licenseCardToken: licenseCardTokenData != null ? (licenseCardTokenData as List).map((e) => e as String).toList(): null,
+			identityCardToken: identityCardTokenData != null ? (identityCardTokenData as List).map((e) => e as String).toList(): null,
 			applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
 			applyNote: map['ApplyNote'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
@@ -60,6 +68,10 @@ class IdentityApplyDTO extends BaseDTO{
 			map['IdentityCard'] = identityCard;
 		if(licenseCard != null)
 			map['LicenseCard'] = licenseCard;
+		if(licenseCardToken != null)
+			map['LicenseCardToken'] = licenseCardToken;
+		if(identityCardToken != null)
+			map['IdentityCardToken'] = identityCardToken;
 		map['ApplyState'] = applyState.index;
 		if(applyNote != null)
 			map['ApplyNote'] = applyNote;
@@ -92,33 +104,20 @@ class GetLastIdentityApplyRequest extends TokenRequest{
 	}
 }
 
-class ApplyForRequest extends IdentityApplyDTO{
+class ApplyForRequest {
 	String? token;
 	String? extensionData;
+	String? applyRoleCode;
+	List<String>? identityCard;
+	List<String>? licenseCard;
 
 	ApplyForRequest({
 		this.token,
 		this.extensionData,
-		String? identityApplyCode,
-		String? userCode,
-		String? applyRoleCode,
-		List<String>? identityCard,
-		List<String>? licenseCard,
-		ApplyStateEnum applyState = ApplyStateEnum.NotApply,
-		String? applyNote,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			identityApplyCode: identityApplyCode,
-			userCode: userCode,
-			applyRoleCode: applyRoleCode,
-			identityCard: identityCard,
-			licenseCard: licenseCard,
-			applyState: applyState,
-			applyNote: applyNote,
-			createTime: createTime,
-			updateTime: updateTime,
-		);
+		this.applyRoleCode,
+		this.identityCard,
+		this.licenseCard,
+	});
 
 	factory ApplyForRequest.fromJson(Map<String, dynamic> map) {
 		final identityCardData = map['IdentityCard'];
@@ -126,24 +125,24 @@ class ApplyForRequest extends IdentityApplyDTO{
 		return ApplyForRequest( 
 			token: map['Token'],
 			extensionData: map['ExtensionData'],
-			identityApplyCode: map['IdentityApplyCode'],
-			userCode: map['UserCode'],
 			applyRoleCode: map['ApplyRoleCode'],
 			identityCard: identityCardData != null ? (identityCardData as List).map((e) => e as String).toList(): null,
 			licenseCard: licenseCardData != null ? (licenseCardData as List).map((e) => e as String).toList(): null,
-			applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
-			applyNote: map['ApplyNote'],
-			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();
+		final map = Map<String, dynamic>();
 		if(token != null)
 			map['Token'] = token;
 		if(extensionData != null)
 			map['ExtensionData'] = extensionData;
+		if(applyRoleCode != null)
+			map['ApplyRoleCode'] = applyRoleCode;
+		if(identityCard != null)
+			map['IdentityCard'] = identityCard;
+		if(licenseCard != null)
+			map['LicenseCard'] = licenseCard;
 		return map;
 	}
 }

+ 5 - 0
lib/services/index.dart

@@ -1,9 +1,11 @@
 export 'authentication.dart';
 export 'clientLog.dart';
+export 'connect.dart';
 export 'device.dart';
 export 'email.dart';
 export 'identityApply.dart';
 export 'login.dart';
+export 'notification.dart';
 export 'organization.dart';
 export 'patient.dart';
 export 'platform.dart';
@@ -17,9 +19,11 @@ export 'sMS.dart';
 export 'storage.dart';
 export 'user.dart';
 export 'authentication.m.dart';
+export 'connect.m.dart';
 export 'device.m.dart';
 export 'identityApply.m.dart';
 export 'login.m.dart';
+export 'notification.m.dart';
 export 'organization.m.dart';
 export 'patient.m.dart';
 export 'platform.m.dart';
@@ -27,6 +31,7 @@ export 'position.m.dart';
 export 'rank.m.dart';
 export 'recordInfo.m.dart';
 export 'region.m.dart';
+export 'remedical.m.dart';
 export 'role.m.dart';
 export 'storage.m.dart';
 export 'user.m.dart';

+ 32 - 0
lib/services/notification.dart

@@ -0,0 +1,32 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+
+import 'notification.m.dart';
+
+
+class NotificationService extends JsonRpcClientBase {
+	NotificationService(
+		String host, {
+		String serviceName = "INotificationService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				);
+
+	Future<bool> subscribeNotify(SubscribeNotifyRequest request) async {
+		var rpcRst = await call("SubscribeNotify", request);
+		return rpcRst;
+	}
+
+	Future<bool> sendNotification(SendNotificationRequest request) async {
+		var rpcRst = await call("SendNotification", request);
+		return rpcRst;
+	}
+
+}
+

+ 100 - 0
lib/services/notification.m.dart

@@ -0,0 +1,100 @@
+class SubscribeNotifyRequest {
+	String? userCode;
+	String? token;
+
+	SubscribeNotifyRequest({
+		this.userCode,
+		this.token,
+	});
+
+	factory SubscribeNotifyRequest.fromJson(Map<String, dynamic> map) {
+		return SubscribeNotifyRequest( 
+			userCode: map['UserCode'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(userCode != null)
+			map['UserCode'] = userCode;
+		if(token != null)
+			map['Token'] = token;
+		return map;
+	}
+}
+
+enum MessageTypeEnum {
+	Connection,
+	Disconnect,
+	Notify,
+	Ask,
+	Ack,
+}
+
+enum NotificationTypeEnum {
+	Message,
+	Action,
+	Update,
+}
+
+class NotifyMessage {
+	int length;
+	MessageTypeEnum messageType;
+	NotificationTypeEnum notificationType;
+	String? message;
+
+	NotifyMessage({
+		this.length = 0,
+		this.messageType = MessageTypeEnum.Connection,
+		this.notificationType = NotificationTypeEnum.Message,
+		this.message,
+	});
+
+	factory NotifyMessage.fromJson(Map<String, dynamic> map) {
+		return NotifyMessage( 
+			length: map['Length'],
+			messageType: MessageTypeEnum.values.firstWhere((e) => e.index == map['MessageType']),
+			notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
+			message: map['Message'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['Length'] = length;
+		map['MessageType'] = messageType.index;
+		map['NotificationType'] = notificationType.index;
+		if(message != null)
+			map['Message'] = message;
+		return map;
+	}
+}
+
+class SendNotificationRequest {
+	String? userCode;
+	NotifyMessage? message;
+
+	SendNotificationRequest({
+		this.userCode,
+		this.message,
+	});
+
+	factory SendNotificationRequest.fromJson(Map<String, dynamic> map) {
+		return SendNotificationRequest( 
+			userCode: map['UserCode'],
+			message: map['Message'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(userCode != null)
+			map['UserCode'] = userCode;
+		if(message != null)
+			map['Message'] = message;
+		return map;
+	}
+}
+
+

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

@@ -38,11 +38,13 @@ class OrganizationBasicDTO extends OrganizationBaseDTO{
 	String? regionCode;
 	String? parentCode;
 	String? logoUrl;
+	String? logoUrlToken;
 
 	OrganizationBasicDTO({
 		this.regionCode,
 		this.parentCode,
 		this.logoUrl,
+		this.logoUrlToken,
 		String? organizationCode,
 		String? organizationName,
 		DateTime? createTime,
@@ -59,6 +61,7 @@ class OrganizationBasicDTO extends OrganizationBaseDTO{
 			regionCode: map['RegionCode'],
 			parentCode: map['ParentCode'],
 			logoUrl: map['LogoUrl'],
+			logoUrlToken: map['LogoUrlToken'],
 			organizationCode: map['OrganizationCode'],
 			organizationName: map['OrganizationName'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
@@ -74,6 +77,8 @@ class OrganizationBasicDTO extends OrganizationBaseDTO{
 			map['ParentCode'] = parentCode;
 		if(logoUrl != null)
 			map['LogoUrl'] = logoUrl;
+		if(logoUrlToken != null)
+			map['LogoUrlToken'] = logoUrlToken;
 		return map;
 	}
 }
@@ -112,6 +117,7 @@ class OrganizationDTO extends OrganizationBasicDTO{
 		String? regionCode,
 		String? parentCode,
 		String? logoUrl,
+		String? logoUrlToken,
 		String? organizationCode,
 		String? organizationName,
 		DateTime? createTime,
@@ -120,6 +126,7 @@ class OrganizationDTO extends OrganizationBasicDTO{
 			regionCode: regionCode,
 			parentCode: parentCode,
 			logoUrl: logoUrl,
+			logoUrlToken: logoUrlToken,
 			organizationCode: organizationCode,
 			organizationName: organizationName,
 			createTime: createTime,
@@ -139,6 +146,7 @@ class OrganizationDTO extends OrganizationBasicDTO{
 			regionCode: map['RegionCode'],
 			parentCode: map['ParentCode'],
 			logoUrl: map['LogoUrl'],
+			logoUrlToken: map['LogoUrlToken'],
 			organizationCode: map['OrganizationCode'],
 			organizationName: map['OrganizationName'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
@@ -265,6 +273,7 @@ class SavePersonOrganizationRequest extends OrganizationBasicDTO{
 		String? regionCode,
 		String? parentCode,
 		String? logoUrl,
+		String? logoUrlToken,
 		String? organizationCode,
 		String? organizationName,
 		DateTime? createTime,
@@ -273,6 +282,7 @@ class SavePersonOrganizationRequest extends OrganizationBasicDTO{
 			regionCode: regionCode,
 			parentCode: parentCode,
 			logoUrl: logoUrl,
+			logoUrlToken: logoUrlToken,
 			organizationCode: organizationCode,
 			organizationName: organizationName,
 			createTime: createTime,
@@ -285,6 +295,7 @@ class SavePersonOrganizationRequest extends OrganizationBasicDTO{
 			regionCode: map['RegionCode'],
 			parentCode: map['ParentCode'],
 			logoUrl: map['LogoUrl'],
+			logoUrlToken: map['LogoUrlToken'],
 			organizationCode: map['OrganizationCode'],
 			organizationName: map['OrganizationName'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,

+ 5 - 0
lib/services/patient.dart

@@ -63,5 +63,10 @@ class PatientService extends JsonRpcClientBase {
 		return result;
 	}
 
+	Future<bool> setValidPatient(SetValidPatientRequest request) async {
+		var rpcRst = await call("SetValidPatient", request);
+		return rpcRst;
+	}
+
 }
 

+ 149 - 144
lib/services/patient.m.dart

@@ -124,7 +124,8 @@ class UpdatePatientRequest extends TokenRequest{
 	}
 }
 
-class UploadPatientDTO extends BaseDTO{
+class PatientInfoBaseDTO extends BaseDTO{
+	String? patientCode;
 	String? name;
 	String? phone;
 	String? identityCard;
@@ -132,12 +133,15 @@ class UploadPatientDTO extends BaseDTO{
 	String? age;
 	PatientGenderEnum gender;
 	bool isValid;
-	String? creatorCode;
-	String? sourceCode;
 	String? organizationCode;
 	List<String>? assignmentUserCodes;
+	DateTime? birthday;
+	String? height;
+	String? weight;
+	int unReadRecordCount;
 
-	UploadPatientDTO({
+	PatientInfoBaseDTO({
+		this.patientCode,
 		this.name,
 		this.phone,
 		this.identityCard,
@@ -145,10 +149,12 @@ class UploadPatientDTO extends BaseDTO{
 		this.age,
 		this.gender = PatientGenderEnum.NotFilled,
 		this.isValid = false,
-		this.creatorCode,
-		this.sourceCode,
 		this.organizationCode,
 		this.assignmentUserCodes,
+		this.birthday,
+		this.height,
+		this.weight,
+		this.unReadRecordCount = 0,
 		DateTime? createTime,
 		DateTime? updateTime,
 	}) : super(
@@ -156,8 +162,9 @@ class UploadPatientDTO extends BaseDTO{
 			updateTime: updateTime,
 		);
 
-	factory UploadPatientDTO.fromJson(Map<String, dynamic> map) {
-		return UploadPatientDTO( 
+	factory PatientInfoBaseDTO.fromJson(Map<String, dynamic> map) {
+		return PatientInfoBaseDTO( 
+			patientCode: map['PatientCode'],
 			name: map['Name'],
 			phone: map['Phone'],
 			identityCard: map['IdentityCard'],
@@ -165,10 +172,12 @@ class UploadPatientDTO extends BaseDTO{
 			age: map['Age'],
 			gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
 			isValid: map['IsValid'],
-			creatorCode: map['CreatorCode'],
-			sourceCode: map['SourceCode'],
 			organizationCode: map['OrganizationCode'],
 			assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
+			birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
+			height: map['Height'],
+			weight: map['Weight'],
+			unReadRecordCount: map['UnReadRecordCount'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
 			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
 		);
@@ -176,6 +185,8 @@ class UploadPatientDTO extends BaseDTO{
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
+		if(patientCode != null)
+			map['PatientCode'] = patientCode;
 		if(name != null)
 			map['Name'] = name;
 		if(phone != null)
@@ -188,75 +199,73 @@ class UploadPatientDTO extends BaseDTO{
 			map['Age'] = age;
 		map['Gender'] = gender.index;
 		map['IsValid'] = isValid;
-		if(creatorCode != null)
-			map['CreatorCode'] = creatorCode;
-		if(sourceCode != null)
-			map['SourceCode'] = sourceCode;
 		if(organizationCode != null)
 			map['OrganizationCode'] = organizationCode;
 		if(assignmentUserCodes != null)
 			map['AssignmentUserCodes'] = assignmentUserCodes;
+		if(birthday != null)
+			map['Birthday'] = JsonRpcUtils.dateFormat(birthday!);
+		if(height != null)
+			map['Height'] = height;
+		if(weight != null)
+			map['Weight'] = weight;
+		map['UnReadRecordCount'] = unReadRecordCount;
 		return map;
 	}
 }
 
-class CreatePatientsRequest extends TokenRequest{
-	List<UploadPatientDTO>? patients;
-
-	CreatePatientsRequest({
-		this.patients,
-		String? token,
-	}) : super(
-			token: token,
-		);
-
-	factory CreatePatientsRequest.fromJson(Map<String, dynamic> map) {
-		return CreatePatientsRequest( 
-			patients: map['Patients'] != null ? map['Patients'].map((e)=>UploadPatientDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
-			token: map['Token'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = super.toJson();
-		if(patients != null)
-			map['Patients'] = patients;
-		return map;
-	}
-}
-
-class PatientInfoBaseDTO extends BaseDTO{
-	String? patientCode;
-	String? name;
-	String? phone;
-	String? identityCard;
-	String? insuranceCode;
-	String? age;
-	PatientGenderEnum gender;
-	bool isValid;
-	String? organizationCode;
-	List<String>? assignmentUserCodes;
+class PatientInfoDTO extends PatientInfoBaseDTO{
+	List<String>? recordCodes;
+	String? creatorCode;
+	String? sourceCode;
+	String? deviceCode;
 
-	PatientInfoBaseDTO({
-		this.patientCode,
-		this.name,
-		this.phone,
-		this.identityCard,
-		this.insuranceCode,
-		this.age,
-		this.gender = PatientGenderEnum.NotFilled,
-		this.isValid = false,
-		this.organizationCode,
-		this.assignmentUserCodes,
+	PatientInfoDTO({
+		this.recordCodes,
+		this.creatorCode,
+		this.sourceCode,
+		this.deviceCode,
+		String? patientCode,
+		String? name,
+		String? phone,
+		String? identityCard,
+		String? insuranceCode,
+		String? age,
+		PatientGenderEnum gender = PatientGenderEnum.NotFilled,
+		bool isValid = false,
+		String? organizationCode,
+		List<String>? assignmentUserCodes,
+		DateTime? birthday,
+		String? height,
+		String? weight,
+		int unReadRecordCount = 0,
 		DateTime? createTime,
 		DateTime? updateTime,
 	}) : super(
+			patientCode: patientCode,
+			name: name,
+			phone: phone,
+			identityCard: identityCard,
+			insuranceCode: insuranceCode,
+			age: age,
+			gender: gender,
+			isValid: isValid,
+			organizationCode: organizationCode,
+			assignmentUserCodes: assignmentUserCodes,
+			birthday: birthday,
+			height: height,
+			weight: weight,
+			unReadRecordCount: unReadRecordCount,
 			createTime: createTime,
 			updateTime: updateTime,
 		);
 
-	factory PatientInfoBaseDTO.fromJson(Map<String, dynamic> map) {
-		return PatientInfoBaseDTO( 
+	factory PatientInfoDTO.fromJson(Map<String, dynamic> map) {
+		return PatientInfoDTO( 
+			recordCodes: map['RecordCodes'] != null ? map['RecordCodes'].cast<String>().toList() : null,
+			creatorCode: map['CreatorCode'],
+			sourceCode: map['SourceCode'],
+			deviceCode: map['DeviceCode'],
 			patientCode: map['PatientCode'],
 			name: map['Name'],
 			phone: map['Phone'],
@@ -267,6 +276,10 @@ class PatientInfoBaseDTO extends BaseDTO{
 			isValid: map['IsValid'],
 			organizationCode: map['OrganizationCode'],
 			assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
+			birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
+			height: map['Height'],
+			weight: map['Weight'],
+			unReadRecordCount: map['UnReadRecordCount'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
 			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
 		);
@@ -274,24 +287,39 @@ class PatientInfoBaseDTO extends BaseDTO{
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		if(patientCode != null)
-			map['PatientCode'] = patientCode;
-		if(name != null)
-			map['Name'] = name;
-		if(phone != null)
-			map['Phone'] = phone;
-		if(identityCard != null)
-			map['IdentityCard'] = identityCard;
-		if(insuranceCode != null)
-			map['InsuranceCode'] = insuranceCode;
-		if(age != null)
-			map['Age'] = age;
-		map['Gender'] = gender.index;
-		map['IsValid'] = isValid;
-		if(organizationCode != null)
-			map['OrganizationCode'] = organizationCode;
-		if(assignmentUserCodes != null)
-			map['AssignmentUserCodes'] = assignmentUserCodes;
+		if(recordCodes != null)
+			map['RecordCodes'] = recordCodes;
+		if(creatorCode != null)
+			map['CreatorCode'] = creatorCode;
+		if(sourceCode != null)
+			map['SourceCode'] = sourceCode;
+		if(deviceCode != null)
+			map['DeviceCode'] = deviceCode;
+		return map;
+	}
+}
+
+class CreatePatientsRequest extends TokenRequest{
+	List<PatientInfoDTO>? patients;
+
+	CreatePatientsRequest({
+		this.patients,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory CreatePatientsRequest.fromJson(Map<String, dynamic> map) {
+		return CreatePatientsRequest( 
+			patients: map['Patients'] != null ? map['Patients'].map((e)=>PatientInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(patients != null)
+			map['Patients'] = patients;
 		return map;
 	}
 }
@@ -362,15 +390,23 @@ class PageRequest extends TokenRequest{
 	}
 }
 
+enum PatientValidStatusEnum {
+	All,
+	CheckOut,
+	CheckIn,
+}
+
 class FindPatientsPageRequest extends PageRequest{
 	String? keyWord;
 	DateTime? startTime;
 	DateTime? endTime;
+	PatientValidStatusEnum isValid;
 
 	FindPatientsPageRequest({
 		this.keyWord,
 		this.startTime,
 		this.endTime,
+		this.isValid = PatientValidStatusEnum.All,
 		int pageIndex = 0,
 		int pageSize = 0,
 		String? token,
@@ -385,6 +421,7 @@ class FindPatientsPageRequest extends PageRequest{
 			keyWord: map['KeyWord'],
 			startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
 			endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
+			isValid: PatientValidStatusEnum.values.firstWhere((e) => e.index == map['IsValid']),
 			pageIndex: map['PageIndex'],
 			pageSize: map['PageSize'],
 			token: map['Token'],
@@ -399,69 +436,7 @@ class FindPatientsPageRequest extends PageRequest{
 			map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
 		if(endTime != null)
 			map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
-		return map;
-	}
-}
-
-class PatientInfoDTO extends PatientInfoBaseDTO{
-	List<String>? recordCodes;
-	String? creatorCode;
-
-	PatientInfoDTO({
-		this.recordCodes,
-		this.creatorCode,
-		String? patientCode,
-		String? name,
-		String? phone,
-		String? identityCard,
-		String? insuranceCode,
-		String? age,
-		PatientGenderEnum gender = PatientGenderEnum.NotFilled,
-		bool isValid = false,
-		String? organizationCode,
-		List<String>? assignmentUserCodes,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			patientCode: patientCode,
-			name: name,
-			phone: phone,
-			identityCard: identityCard,
-			insuranceCode: insuranceCode,
-			age: age,
-			gender: gender,
-			isValid: isValid,
-			organizationCode: organizationCode,
-			assignmentUserCodes: assignmentUserCodes,
-			createTime: createTime,
-			updateTime: updateTime,
-		);
-
-	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'],
-			identityCard: map['IdentityCard'],
-			insuranceCode: map['InsuranceCode'],
-			age: map['Age'],
-			gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
-			isValid: map['IsValid'],
-			organizationCode: map['OrganizationCode'],
-			assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
-			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(recordCodes != null)
-			map['RecordCodes'] = recordCodes;
-		if(creatorCode != null)
-			map['CreatorCode'] = creatorCode;
+		map['IsValid'] = isValid.index;
 		return map;
 	}
 }
@@ -546,4 +521,34 @@ class FindValidPatientsByNameRequest extends TokenRequest{
 	}
 }
 
+class SetValidPatientRequest extends TokenRequest{
+	String? newPatientCode;
+	String? oldPatientCode;
+
+	SetValidPatientRequest({
+		this.newPatientCode,
+		this.oldPatientCode,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory SetValidPatientRequest.fromJson(Map<String, dynamic> map) {
+		return SetValidPatientRequest( 
+			newPatientCode: map['NewPatientCode'],
+			oldPatientCode: map['OldPatientCode'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(newPatientCode != null)
+			map['NewPatientCode'] = newPatientCode;
+		if(oldPatientCode != null)
+			map['OldPatientCode'] = oldPatientCode;
+		return map;
+	}
+}
+
 

+ 66 - 20
lib/services/recordInfo.m.dart

@@ -1,17 +1,67 @@
 import 'authentication.m.dart';
 import 'patient.m.dart';
 
+class DataItemDTO {
+	String? key;
+	String? value;
+
+	DataItemDTO({
+		this.key,
+		this.value,
+	});
+
+	factory DataItemDTO.fromJson(Map<String, dynamic> map) {
+		return DataItemDTO( 
+			key: map['Key'],
+			value: map['Value'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(key != null)
+			map['Key'] = key;
+		if(value != null)
+			map['Value'] = value;
+		return map;
+	}
+}
+
+class PatientInfoExt {
+	String? patientScanType;
+	List<DataItemDTO>? content;
+
+	PatientInfoExt({
+		this.patientScanType,
+		this.content,
+	});
+
+	factory PatientInfoExt.fromJson(Map<String, dynamic> map) {
+		return PatientInfoExt( 
+			patientScanType: map['PatientScanType'],
+			content: map['Content'] != null ? map['Content'].map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(patientScanType != null)
+			map['PatientScanType'] = patientScanType;
+		if(content != null)
+			map['Content'] = content;
+		return map;
+	}
+}
+
 class CreateRecordRequest extends TokenRequest{
 	String? patientCode;
 	String? deviceCode;
-	String? checkProject;
-	String? recordContent;
+	List<PatientInfoExt>? patientInfoExtList;
 
 	CreateRecordRequest({
 		this.patientCode,
 		this.deviceCode,
-		this.checkProject,
-		this.recordContent,
+		this.patientInfoExtList,
 		String? token,
 	}) : super(
 			token: token,
@@ -21,8 +71,7 @@ class CreateRecordRequest extends TokenRequest{
 		return CreateRecordRequest( 
 			patientCode: map['PatientCode'],
 			deviceCode: map['DeviceCode'],
-			checkProject: map['CheckProject'],
-			recordContent: map['RecordContent'],
+			patientInfoExtList: map['PatientInfoExtList'] != null ? map['PatientInfoExtList'].map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
 			token: map['Token'],
 		);
 	}
@@ -33,10 +82,8 @@ class CreateRecordRequest extends TokenRequest{
 			map['PatientCode'] = patientCode;
 		if(deviceCode != null)
 			map['DeviceCode'] = deviceCode;
-		if(checkProject != null)
-			map['CheckProject'] = checkProject;
-		if(recordContent != null)
-			map['RecordContent'] = recordContent;
+		if(patientInfoExtList != null)
+			map['PatientInfoExtList'] = patientInfoExtList;
 		return map;
 	}
 }
@@ -55,6 +102,7 @@ class GetRecordsPageResult {
 	String? reportNum;
 	String? recordCode;
 	RecordStatusEnum recordStatus;
+	bool isRead;
 
 	GetRecordsPageResult({
 		this.createTime,
@@ -64,6 +112,7 @@ class GetRecordsPageResult {
 		this.reportNum,
 		this.recordCode,
 		this.recordStatus = RecordStatusEnum.NotScanned,
+		this.isRead = false,
 	});
 
 	factory GetRecordsPageResult.fromJson(Map<String, dynamic> map) {
@@ -75,6 +124,7 @@ class GetRecordsPageResult {
 			reportNum: map['ReportNum'],
 			recordCode: map['RecordCode'],
 			recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
+			isRead: map['IsRead'],
 		);
 	}
 
@@ -93,6 +143,7 @@ class GetRecordsPageResult {
 		if(recordCode != null)
 			map['RecordCode'] = recordCode;
 		map['RecordStatus'] = recordStatus.index;
+		map['IsRead'] = isRead;
 		return map;
 	}
 }
@@ -136,9 +187,8 @@ class QueryRecordResult {
 	PatientGenderEnum patientSex;
 	String? creatorName;
 	String? deviceName;
-	String? checkProject;
-	String? recordContent;
 	RecordStatusEnum recordStatus;
+	List<PatientInfoExt>? patientInfoExtList;
 
 	QueryRecordResult({
 		this.createTime,
@@ -148,9 +198,8 @@ class QueryRecordResult {
 		this.patientSex = PatientGenderEnum.NotFilled,
 		this.creatorName,
 		this.deviceName,
-		this.checkProject,
-		this.recordContent,
 		this.recordStatus = RecordStatusEnum.NotScanned,
+		this.patientInfoExtList,
 	});
 
 	factory QueryRecordResult.fromJson(Map<String, dynamic> map) {
@@ -162,9 +211,8 @@ class QueryRecordResult {
 			patientSex: PatientGenderEnum.values.firstWhere((e) => e.index == map['PatientSex']),
 			creatorName: map['CreatorName'],
 			deviceName: map['DeviceName'],
-			checkProject: map['CheckProject'],
-			recordContent: map['RecordContent'],
 			recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
+			patientInfoExtList: map['PatientInfoExtList'] != null ? map['PatientInfoExtList'].map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
 		);
 	}
 
@@ -183,11 +231,9 @@ class QueryRecordResult {
 			map['CreatorName'] = creatorName;
 		if(deviceName != null)
 			map['DeviceName'] = deviceName;
-		if(checkProject != null)
-			map['CheckProject'] = checkProject;
-		if(recordContent != null)
-			map['RecordContent'] = recordContent;
 		map['RecordStatus'] = recordStatus.index;
+		if(patientInfoExtList != null)
+			map['PatientInfoExtList'] = patientInfoExtList;
 		return map;
 	}
 }

+ 47 - 1
lib/services/remedical.dart

@@ -1,7 +1,13 @@
 import 'dart:core';
 
 import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
 
+import 'remedical.m.dart';
+
+import 'recordInfo.m.dart';
+import 'authentication.m.dart';
+import 'patient.m.dart';
 
 
 class RemedicalService extends JsonRpcClientBase {
@@ -15,7 +21,47 @@ class RemedicalService extends JsonRpcClientBase {
 						serviceName,
 						headers: headers,
 						timeout: timeout,
-				);
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => CreateExaminfoResult.fromJson(map));
+		FJsonConvert.setDecoder((map) => RemedicalListResult.fromJson(map));
+		FJsonConvert.setDecoder((map) => PageResult<RemedicalListResult>.fromJson(map));
+		FJsonConvert.setDecoder((map) => DataItemDTO.fromJson(map));
+	}
+
+	Future<CreateExaminfoResult> createExamInfo(CreateExaminfoRequest request) async {
+		var rpcRst = await call("CreateExamInfo", request);
+		var result = CreateExaminfoResult.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<bool> uploadExamData(UploadExamDataRequest request) async {
+		var rpcRst = await call("UploadExamData", request);
+		return rpcRst;
+	}
+
+	Future<RemedicalListResult> getRemedicalListByRecordInfoAsync(QueryRecordRequest request) async {
+		var rpcRst = await call("GetRemedicalListByRecordInfoAsync", request);
+		var result = RemedicalListResult.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<PageResult<RemedicalListResult>> getRemedicalListPagesAsync(GetRecordsPageRequest request) async {
+		var rpcRst = await call("GetRemedicalListPagesAsync", request);
+		var result = PageResult<RemedicalListResult>.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<int> getUnReadExamNum(TokenRequest request) async {
+		var rpcRst = await call("GetUnReadExamNum", request);
+		return rpcRst;
+	}
+
+	Future<List<DataItemDTO>> queryDropdownList(QueryDropdownListReuqest request) async {
+		var rpcRst = await call("QueryDropdownList", request);
+		var result = (rpcRst as List).map((e)=>DataItemDTO.fromJson(e as Map<String, dynamic>)).toList();
+		return result;
+	}
 
 }
 

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

@@ -0,0 +1,440 @@
+import 'authentication.m.dart';
+import 'patient.m.dart';
+import 'recordInfo.m.dart';
+import 'device.m.dart';
+
+import 'package:fis_jsonrpc/utils.dart';
+
+class CreateExaminfoResult {
+	String? examCode;
+
+	CreateExaminfoResult({
+		this.examCode,
+	});
+
+	factory CreateExaminfoResult.fromJson(Map<String, dynamic> map) {
+		return CreateExaminfoResult( 
+			examCode: map['ExamCode'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(examCode != null)
+			map['ExamCode'] = examCode;
+		return map;
+	}
+}
+
+class ExamPatientDTO {
+	String? iD;
+	String? name;
+	String? phone;
+	String? identityCard;
+	String? insuranceCode;
+	DateTime? birthday;
+	int age;
+	PatientGenderEnum gender;
+	String? height;
+	String? weight;
+
+	ExamPatientDTO({
+		this.iD,
+		this.name,
+		this.phone,
+		this.identityCard,
+		this.insuranceCode,
+		this.birthday,
+		this.age = 0,
+		this.gender = PatientGenderEnum.NotFilled,
+		this.height,
+		this.weight,
+	});
+
+	factory ExamPatientDTO.fromJson(Map<String, dynamic> map) {
+		return ExamPatientDTO( 
+			iD: map['ID'],
+			name: map['Name'],
+			phone: map['Phone'],
+			identityCard: map['IdentityCard'],
+			insuranceCode: map['InsuranceCode'],
+			birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
+			age: map['Age'],
+			gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
+			height: map['Height'],
+			weight: map['Weight'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(iD != null)
+			map['ID'] = iD;
+		if(name != null)
+			map['Name'] = name;
+		if(phone != null)
+			map['Phone'] = phone;
+		if(identityCard != null)
+			map['IdentityCard'] = identityCard;
+		if(insuranceCode != null)
+			map['InsuranceCode'] = insuranceCode;
+		if(birthday != null)
+			map['Birthday'] = JsonRpcUtils.dateFormat(birthday!);
+		map['Age'] = age;
+		map['Gender'] = gender.index;
+		if(height != null)
+			map['Height'] = height;
+		if(weight != null)
+			map['Weight'] = weight;
+		return map;
+	}
+}
+
+class CreateExaminfoRequest extends TokenRequest{
+	String? patientType;
+	String? subPatientType;
+	String? reservationCode;
+	ExamPatientDTO? patientInfo;
+	List<PatientInfoExt>? patientInfoExtList;
+
+	CreateExaminfoRequest({
+		this.patientType,
+		this.subPatientType,
+		this.reservationCode,
+		this.patientInfo,
+		this.patientInfoExtList,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory CreateExaminfoRequest.fromJson(Map<String, dynamic> map) {
+		return CreateExaminfoRequest( 
+			patientType: map['PatientType'],
+			subPatientType: map['SubPatientType'],
+			reservationCode: map['ReservationCode'],
+			patientInfo: map['PatientInfo'],
+			patientInfoExtList: map['PatientInfoExtList'] != null ? map['PatientInfoExtList'].map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(patientType != null)
+			map['PatientType'] = patientType;
+		if(subPatientType != null)
+			map['SubPatientType'] = subPatientType;
+		if(reservationCode != null)
+			map['ReservationCode'] = reservationCode;
+		if(patientInfo != null)
+			map['PatientInfo'] = patientInfo;
+		if(patientInfoExtList != null)
+			map['PatientInfoExtList'] = patientInfoExtList;
+		return map;
+	}
+}
+
+class UploadExamDataRequest extends TokenRequest{
+	String? examCode;
+	String? previewFileToken;
+	String? fileToken;
+	String? application;
+	String? patientScanType;
+
+	UploadExamDataRequest({
+		this.examCode,
+		this.previewFileToken,
+		this.fileToken,
+		this.application,
+		this.patientScanType,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory UploadExamDataRequest.fromJson(Map<String, dynamic> map) {
+		return UploadExamDataRequest( 
+			examCode: map['ExamCode'],
+			previewFileToken: map['PreviewFileToken'],
+			fileToken: map['FileToken'],
+			application: map['Application'],
+			patientScanType: map['PatientScanType'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(examCode != null)
+			map['ExamCode'] = examCode;
+		if(previewFileToken != null)
+			map['PreviewFileToken'] = previewFileToken;
+		if(fileToken != null)
+			map['FileToken'] = fileToken;
+		if(application != null)
+			map['Application'] = application;
+		if(patientScanType != null)
+			map['PatientScanType'] = patientScanType;
+		return map;
+	}
+}
+
+class TerminalImageDTO {
+	String? previewUrl;
+	String? imageUrl;
+
+	TerminalImageDTO({
+		this.previewUrl,
+		this.imageUrl,
+	});
+
+	factory TerminalImageDTO.fromJson(Map<String, dynamic> map) {
+		return TerminalImageDTO( 
+			previewUrl: map['PreviewUrl'],
+			imageUrl: map['ImageUrl'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(previewUrl != null)
+			map['PreviewUrl'] = previewUrl;
+		if(imageUrl != null)
+			map['ImageUrl'] = imageUrl;
+		return map;
+	}
+}
+
+enum RemedicalFileDataTypeEnum {
+	VinnoVidSingle,
+	ThirdVidSingle,
+	VinnoVidMovie,
+	ThirdVidMovie,
+	Image,
+}
+
+enum RemedicalImageLocationTypeEnum {
+	BreastImageLocation,
+	LiverImageLocation,
+	ThyroidImageLocation,
+	PositionImageLocation,
+}
+
+enum RemedicalImagePositionTypeEnum {
+	None,
+	Left,
+	Right,
+	Middle,
+}
+
+enum RemedicalApparatusTypeEnum {
+	BreastOuterUpper,
+	BreastInnerUpper,
+	BreastOuterLower,
+	BreastInnerLower,
+	Lobe,
+	LobeOfUnder,
+	LobeOfInter,
+	Thyroid,
+	Abdomen,
+}
+
+class ImageLocationDTO {
+	RemedicalImageLocationTypeEnum imageLocationType;
+	RemedicalImagePositionTypeEnum position;
+	String? scanLocationName;
+	RemedicalApparatusTypeEnum apparatusType;
+
+	ImageLocationDTO({
+		this.imageLocationType = RemedicalImageLocationTypeEnum.BreastImageLocation,
+		this.position = RemedicalImagePositionTypeEnum.None,
+		this.scanLocationName,
+		this.apparatusType = RemedicalApparatusTypeEnum.BreastOuterUpper,
+	});
+
+	factory ImageLocationDTO.fromJson(Map<String, dynamic> map) {
+		return ImageLocationDTO( 
+			imageLocationType: RemedicalImageLocationTypeEnum.values.firstWhere((e) => e.index == map['ImageLocationType']),
+			position: RemedicalImagePositionTypeEnum.values.firstWhere((e) => e.index == map['Position']),
+			scanLocationName: map['ScanLocationName'],
+			apparatusType: RemedicalApparatusTypeEnum.values.firstWhere((e) => e.index == map['ApparatusType']),
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['ImageLocationType'] = imageLocationType.index;
+		map['Position'] = position.index;
+		if(scanLocationName != null)
+			map['ScanLocationName'] = scanLocationName;
+		map['ApparatusType'] = apparatusType.index;
+		return map;
+	}
+}
+
+enum RemedicalAIDiagnosisStatusEnum {
+	Null,
+	NoObviousLesion,
+	Benign,
+	Malignant,
+	BenignAndMalignant,
+}
+
+class RemedicalInfoDTO extends BaseDTO{
+	String? remedicalCode;
+	String? patientCode;
+	String? recordCode;
+	String? patientScanType;
+	String? application;
+	TerminalImageDTO? terminalImages;
+	RemedicalFileDataTypeEnum fileDataType;
+	ImageLocationDTO? imageLocation;
+	RemedicalAIDiagnosisStatusEnum aIDiagnosisStatus;
+
+	RemedicalInfoDTO({
+		this.remedicalCode,
+		this.patientCode,
+		this.recordCode,
+		this.patientScanType,
+		this.application,
+		this.terminalImages,
+		this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
+		this.imageLocation,
+		this.aIDiagnosisStatus = RemedicalAIDiagnosisStatusEnum.Null,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory RemedicalInfoDTO.fromJson(Map<String, dynamic> map) {
+		return RemedicalInfoDTO( 
+			remedicalCode: map['RemedicalCode'],
+			patientCode: map['PatientCode'],
+			recordCode: map['RecordCode'],
+			patientScanType: map['PatientScanType'],
+			application: map['Application'],
+			terminalImages: map['TerminalImages'],
+			fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
+			imageLocation: map['ImageLocation'],
+			aIDiagnosisStatus: RemedicalAIDiagnosisStatusEnum.values.firstWhere((e) => e.index == map['AIDiagnosisStatus']),
+			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(remedicalCode != null)
+			map['RemedicalCode'] = remedicalCode;
+		if(patientCode != null)
+			map['PatientCode'] = patientCode;
+		if(recordCode != null)
+			map['RecordCode'] = recordCode;
+		if(patientScanType != null)
+			map['PatientScanType'] = patientScanType;
+		if(application != null)
+			map['Application'] = application;
+		if(terminalImages != null)
+			map['TerminalImages'] = terminalImages;
+		map['FileDataType'] = fileDataType.index;
+		if(imageLocation != null)
+			map['ImageLocation'] = imageLocation;
+		map['AIDiagnosisStatus'] = aIDiagnosisStatus.index;
+		return map;
+	}
+}
+
+class RemedicalItemList {
+	String? patientScanTypeDesc;
+	List<RemedicalInfoDTO>? remedicalList;
+
+	RemedicalItemList({
+		this.patientScanTypeDesc,
+		this.remedicalList,
+	});
+
+	factory RemedicalItemList.fromJson(Map<String, dynamic> map) {
+		return RemedicalItemList( 
+			patientScanTypeDesc: map['PatientScanTypeDesc'],
+			remedicalList: map['RemedicalList'] != null ? map['RemedicalList'].map((e)=>RemedicalInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(patientScanTypeDesc != null)
+			map['PatientScanTypeDesc'] = patientScanTypeDesc;
+		if(remedicalList != null)
+			map['RemedicalList'] = remedicalList;
+		return map;
+	}
+}
+
+class RemedicalListResult {
+	String? sacnDate;
+	String? recordCode;
+	List<RemedicalItemList>? remedicalItemList;
+
+	RemedicalListResult({
+		this.sacnDate,
+		this.recordCode,
+		this.remedicalItemList,
+	});
+
+	factory RemedicalListResult.fromJson(Map<String, dynamic> map) {
+		return RemedicalListResult( 
+			sacnDate: map['SacnDate'],
+			recordCode: map['RecordCode'],
+			remedicalItemList: map['RemedicalItemList'] != null ? map['RemedicalItemList'].map((e)=>RemedicalItemList.fromJson(e as Map<String,dynamic>)).toList() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(sacnDate != null)
+			map['SacnDate'] = sacnDate;
+		if(recordCode != null)
+			map['RecordCode'] = recordCode;
+		if(remedicalItemList != null)
+			map['RemedicalItemList'] = remedicalItemList;
+		return map;
+	}
+}
+
+enum QueryDropdownListEnum {
+	Org,
+}
+
+class QueryDropdownListReuqest extends TokenRequest{
+	QueryDropdownListEnum queryType;
+	String? queryValue;
+
+	QueryDropdownListReuqest({
+		this.queryType = QueryDropdownListEnum.Org,
+		this.queryValue,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory QueryDropdownListReuqest.fromJson(Map<String, dynamic> map) {
+		return QueryDropdownListReuqest( 
+			queryType: QueryDropdownListEnum.values.firstWhere((e) => e.index == map['QueryType']),
+			queryValue: map['QueryValue'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		map['QueryType'] = queryType.index;
+		if(queryValue != null)
+			map['QueryValue'] = queryValue;
+		return map;
+	}
+}
+
+

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

@@ -54,6 +54,7 @@ enum RoleQualificationEnum {
 class RoleDTO extends BaseRoleDTO{
 	RoleShowTypeEnum roleShowType;
 	String? iConUrl;
+	String? iConUrlToken;
 	String? colorStart;
 	String? colorEnd;
 	RoleQualificationEnum roleQualification;
@@ -62,6 +63,7 @@ class RoleDTO extends BaseRoleDTO{
 	RoleDTO({
 		this.roleShowType = RoleShowTypeEnum.NotShow,
 		this.iConUrl,
+		this.iConUrlToken,
 		this.colorStart,
 		this.colorEnd,
 		this.roleQualification = RoleQualificationEnum.NoNeed,
@@ -83,6 +85,7 @@ class RoleDTO extends BaseRoleDTO{
 		return RoleDTO( 
 			roleShowType: RoleShowTypeEnum.values.firstWhere((e) => e.index == map['RoleShowType']),
 			iConUrl: map['IConUrl'],
+			iConUrlToken: map['IConUrlToken'],
 			colorStart: map['ColorStart'],
 			colorEnd: map['ColorEnd'],
 			roleQualification: RoleQualificationEnum.values.firstWhere((e) => e.index == map['RoleQualification']),
@@ -100,6 +103,8 @@ class RoleDTO extends BaseRoleDTO{
 		map['RoleShowType'] = roleShowType.index;
 		if(iConUrl != null)
 			map['IConUrl'] = iConUrl;
+		if(iConUrlToken != null)
+			map['IConUrlToken'] = iConUrlToken;
 		if(colorStart != null)
 			map['ColorStart'] = colorStart;
 		if(colorEnd != null)

+ 11 - 1
lib/services/storage.dart

@@ -1,6 +1,7 @@
 import 'dart:core';
 
 import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
 
 import 'storage.m.dart';
 
@@ -16,12 +17,21 @@ class StorageService extends JsonRpcClientBase {
 						serviceName,
 						headers: headers,
 						timeout: timeout,
-				);
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => StorageServiceSettingDTO.fromJson(map));
+	}
 
 	Future<bool> uploadFileAsync(StorageRequest request) async {
 		var rpcRst = await call("UploadFileAsync", request);
 		return rpcRst;
 	}
 
+	Future<StorageServiceSettingDTO> getAuthorizationAsync(FileServiceRequest request) async {
+		var rpcRst = await call("GetAuthorizationAsync", request);
+		var result = StorageServiceSettingDTO.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
 }
 

+ 122 - 0
lib/services/storage.m.dart

@@ -1,3 +1,5 @@
+import 'authentication.m.dart';
+
 class StorageRequest {
 	List<int>? file;
 	String? authorization;
@@ -30,4 +32,124 @@ class StorageRequest {
 	}
 }
 
+class StorageServiceSettingDTO {
+	String? authorization;
+	String? fileToken;
+	String? contentType;
+	String? storageUrl;
+	String? fileInfo;
+
+	StorageServiceSettingDTO({
+		this.authorization,
+		this.fileToken,
+		this.contentType,
+		this.storageUrl,
+		this.fileInfo,
+	});
+
+	factory StorageServiceSettingDTO.fromJson(Map<String, dynamic> map) {
+		return StorageServiceSettingDTO( 
+			authorization: map['Authorization'],
+			fileToken: map['FileToken'],
+			contentType: map['ContentType'],
+			storageUrl: map['StorageUrl'],
+			fileInfo: map['FileInfo'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(authorization != null)
+			map['Authorization'] = authorization;
+		if(fileToken != null)
+			map['FileToken'] = fileToken;
+		if(contentType != null)
+			map['ContentType'] = contentType;
+		if(storageUrl != null)
+			map['StorageUrl'] = storageUrl;
+		if(fileInfo != null)
+			map['FileInfo'] = fileInfo;
+		return map;
+	}
+}
+
+enum UploadFileTypeEnum {
+	Unknown,
+	EXE,
+	APK,
+	IPA,
+	ZIP,
+	DAT,
+	RAR,
+	PNG,
+	ICON,
+	BMP,
+	JPEG,
+	JPG,
+	GIF,
+	WEBP,
+	TIFF,
+	IMG,
+	PDF,
+	DOC,
+	DOCX,
+	XLS,
+	XLSX,
+	MP4,
+	MSI,
+	VID,
+}
+
+enum StorageServerEnum {
+	VinnoCloud,
+	TencentCloud,
+}
+
+enum StorageNodeEnum {
+	BJStorage,
+	HKStorage,
+	FRAStorage,
+	BOMStorage,
+}
+
+enum StorageBucketEnum {
+	BJ_VinnoBucket,
+}
+
+class FileServiceRequest extends TokenRequest{
+	UploadFileTypeEnum fileTypeEnum;
+	StorageServerEnum serverTypeEnum;
+	StorageNodeEnum storageNodeEnum;
+	StorageBucketEnum storageBucketEnum;
+
+	FileServiceRequest({
+		this.fileTypeEnum = UploadFileTypeEnum.Unknown,
+		this.serverTypeEnum = StorageServerEnum.VinnoCloud,
+		this.storageNodeEnum = StorageNodeEnum.BJStorage,
+		this.storageBucketEnum = StorageBucketEnum.BJ_VinnoBucket,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory FileServiceRequest.fromJson(Map<String, dynamic> map) {
+		return FileServiceRequest( 
+			fileTypeEnum: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FileTypeEnum']),
+			serverTypeEnum: StorageServerEnum.values.firstWhere((e) => e.index == map['ServerTypeEnum']),
+			storageNodeEnum: StorageNodeEnum.values.firstWhere((e) => e.index == map['StorageNodeEnum']),
+			storageBucketEnum: StorageBucketEnum.values.firstWhere((e) => e.index == map['StorageBucketEnum']),
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		map['FileTypeEnum'] = fileTypeEnum.index;
+		map['ServerTypeEnum'] = serverTypeEnum.index;
+		map['StorageNodeEnum'] = storageNodeEnum.index;
+		map['StorageBucketEnum'] = storageBucketEnum.index;
+		return map;
+	}
+}
+
 

+ 21 - 71
lib/services/user.m.dart

@@ -16,6 +16,7 @@ class UserDTO extends BaseDTO{
 	String? nickName;
 	String? fullName;
 	String? headImageUrl;
+	String? headImageUrlToken;
 	String? organizationCode;
 	String? rootOrganizationCode;
 	List<String>? authorityGroups;
@@ -39,6 +40,7 @@ class UserDTO extends BaseDTO{
 		this.nickName,
 		this.fullName,
 		this.headImageUrl,
+		this.headImageUrlToken,
 		this.organizationCode,
 		this.rootOrganizationCode,
 		this.authorityGroups,
@@ -69,6 +71,7 @@ class UserDTO extends BaseDTO{
 			nickName: map['NickName'],
 			fullName: map['FullName'],
 			headImageUrl: map['HeadImageUrl'],
+			headImageUrlToken: map['HeadImageUrlToken'],
 			organizationCode: map['OrganizationCode'],
 			rootOrganizationCode: map['RootOrganizationCode'],
 			authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
@@ -104,6 +107,8 @@ class UserDTO extends BaseDTO{
 			map['FullName'] = fullName;
 		if(headImageUrl != null)
 			map['HeadImageUrl'] = headImageUrl;
+		if(headImageUrlToken != null)
+			map['HeadImageUrlToken'] = headImageUrlToken;
 		if(organizationCode != null)
 			map['OrganizationCode'] = organizationCode;
 		if(rootOrganizationCode != null)
@@ -336,93 +341,33 @@ class SetUserOrganizationInfoRequest extends TokenRequest{
 	}
 }
 
-class AlterPersonInfoRequest extends UserDTO{
+class AlterPersonInfoRequest {
 	String? token;
+	String? nickName;
+	String? headImageUrl;
 
 	AlterPersonInfoRequest({
 		this.token,
-		String? userCode,
-		String? userName,
-		String? phone,
-		String? email,
-		String? nickName,
-		String? fullName,
-		String? headImageUrl,
-		String? organizationCode,
-		String? rootOrganizationCode,
-		List<String>? authorityGroups,
-		List<String>? bindDevices,
-		String? lastIP,
-		int logintimes = 0,
-		UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
-		List<String>? roleCodes,
-		List<String>? rankCodes,
-		List<String>? positionCodes,
-		ApplyStateEnum applyState = ApplyStateEnum.NotApply,
-		String? rankName,
-		String? positionName,
-		bool isDirector = false,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			userCode: userCode,
-			userName: userName,
-			phone: phone,
-			email: email,
-			nickName: nickName,
-			fullName: fullName,
-			headImageUrl: headImageUrl,
-			organizationCode: organizationCode,
-			rootOrganizationCode: rootOrganizationCode,
-			authorityGroups: authorityGroups,
-			bindDevices: bindDevices,
-			lastIP: lastIP,
-			logintimes: logintimes,
-			userState: userState,
-			roleCodes: roleCodes,
-			rankCodes: rankCodes,
-			positionCodes: positionCodes,
-			applyState: applyState,
-			rankName: rankName,
-			positionName: positionName,
-			isDirector: isDirector,
-			createTime: createTime,
-			updateTime: updateTime,
-		);
+		this.nickName,
+		this.headImageUrl,
+	});
 
 	factory AlterPersonInfoRequest.fromJson(Map<String, dynamic> map) {
 		return AlterPersonInfoRequest( 
 			token: map['Token'],
-			userCode: map['UserCode'],
-			userName: map['UserName'],
-			phone: map['Phone'],
-			email: map['Email'],
 			nickName: map['NickName'],
-			fullName: map['FullName'],
 			headImageUrl: map['HeadImageUrl'],
-			organizationCode: map['OrganizationCode'],
-			rootOrganizationCode: map['RootOrganizationCode'],
-			authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
-			bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
-			lastIP: map['LastIP'],
-			logintimes: map['Logintimes'],
-			userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
-			roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
-			rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
-			positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
-			applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
-			rankName: map['RankName'],
-			positionName: map['PositionName'],
-			isDirector: map['IsDirector'],
-			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();
+		final map = Map<String, dynamic>();
 		if(token != null)
 			map['Token'] = token;
+		if(nickName != null)
+			map['NickName'] = nickName;
+		if(headImageUrl != null)
+			map['HeadImageUrl'] = headImageUrl;
 		return map;
 	}
 }
@@ -432,6 +377,7 @@ class ShareDeviceUserDTO extends BaseDTO{
 	String? fullName;
 	String? phone;
 	String? headImageUrl;
+	String? headImageUrlToken;
 	List<String>? rankNames;
 	String? rootOrganizationCode;
 	String? rootOrganizationName;
@@ -441,6 +387,7 @@ class ShareDeviceUserDTO extends BaseDTO{
 		this.fullName,
 		this.phone,
 		this.headImageUrl,
+		this.headImageUrlToken,
 		this.rankNames,
 		this.rootOrganizationCode,
 		this.rootOrganizationName,
@@ -457,6 +404,7 @@ class ShareDeviceUserDTO extends BaseDTO{
 			fullName: map['FullName'],
 			phone: map['Phone'],
 			headImageUrl: map['HeadImageUrl'],
+			headImageUrlToken: map['HeadImageUrlToken'],
 			rankNames: map['RankNames'] != null ? map['RankNames'].cast<String>().toList() : null,
 			rootOrganizationCode: map['RootOrganizationCode'],
 			rootOrganizationName: map['RootOrganizationName'],
@@ -475,6 +423,8 @@ class ShareDeviceUserDTO extends BaseDTO{
 			map['Phone'] = phone;
 		if(headImageUrl != null)
 			map['HeadImageUrl'] = headImageUrl;
+		if(headImageUrlToken != null)
+			map['HeadImageUrlToken'] = headImageUrlToken;
 		if(rankNames != null)
 			map['RankNames'] = rankNames;
 		if(rootOrganizationCode != null)