Browse Source

dll ver - 1.0.3.79

melon.yin 3 years ago
parent
commit
dae858e334

+ 3 - 0
lib/rpc.dart

@@ -70,6 +70,9 @@ class JsonRpcProxy {
 	OrganizationService get organization =>
 	findService(() => new OrganizationService(currentHostAddress));
 
+	PatientService get patient =>
+	findService(() => new PatientService(currentHostAddress));
+
 	PositionService get position =>
 	findService(() => new PositionService(currentHostAddress));
 

+ 1 - 1
lib/services/device.dart

@@ -39,7 +39,7 @@ class DeviceService extends JsonRpcClientBase {
 		return result;
 	}
 
-	Future<PageCollection<DeviceInfoDTO>> getDeviceInfoPageAsync(PageRequest request) async {
+	Future<PageCollection<DeviceInfoDTO>> getDeviceInfoPageAsync(PageFilterRequest request) async {
 		var rpcRst = await call("GetDeviceInfoPageAsync", request);
 		var result = PageCollection<DeviceInfoDTO>.fromJson(rpcRst as Map<String, dynamic>);
 		return result;

+ 4 - 4
lib/services/device.m.dart

@@ -261,13 +261,13 @@ class PageCollection<T> {
 	}
 }
 
-class PageRequest extends BaseRequest{
+class PageFilterRequest extends BaseRequest{
 	int currentPage;
 	int pageSize;
 	Map<String,String>? filter;
 	bool isFuzzy;
 
-	PageRequest({
+	PageFilterRequest({
 		this.currentPage = 0,
 		this.pageSize = 0,
 		this.filter,
@@ -275,8 +275,8 @@ class PageRequest extends BaseRequest{
 	}) : super(
 		);
 
-	factory PageRequest.fromJson(Map<String, dynamic> map) {
-		return PageRequest( 
+	factory PageFilterRequest.fromJson(Map<String, dynamic> map) {
+		return PageFilterRequest( 
 			currentPage: map['CurrentPage'],
 			pageSize: map['PageSize'],
 			filter: map['Filter'] != null ? map['Filter'].cast<String,String>() : null,

+ 13 - 13
lib/services/identityApply.m.dart

@@ -11,7 +11,7 @@ enum ApplyStateEnum {
 class IdentityApplyDTO extends BaseDTO{
 	String? identityApplyCode;
 	String? userCode;
-	String? applyPosition;
+	String? applyRoleCode;
 	List<String>? identityCard;
 	List<String>? licenseCard;
 	ApplyStateEnum applyState;
@@ -20,7 +20,7 @@ class IdentityApplyDTO extends BaseDTO{
 	IdentityApplyDTO({
 		this.identityApplyCode,
 		this.userCode,
-		this.applyPosition,
+		this.applyRoleCode,
 		this.identityCard,
 		this.licenseCard,
 		this.applyState = ApplyStateEnum.NotApply,
@@ -38,7 +38,7 @@ class IdentityApplyDTO extends BaseDTO{
 		return IdentityApplyDTO( 
 			identityApplyCode: map['IdentityApplyCode'],
 			userCode: map['UserCode'],
-			applyPosition: map['ApplyPosition'],
+			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']),
@@ -54,8 +54,8 @@ class IdentityApplyDTO extends BaseDTO{
 			map['IdentityApplyCode'] = identityApplyCode;
 		if(userCode != null)
 			map['UserCode'] = userCode;
-		if(applyPosition != null)
-			map['ApplyPosition'] = applyPosition;
+		if(applyRoleCode != null)
+			map['ApplyRoleCode'] = applyRoleCode;
 		if(identityCard != null)
 			map['IdentityCard'] = identityCard;
 		if(licenseCard != null)
@@ -68,10 +68,10 @@ class IdentityApplyDTO extends BaseDTO{
 }
 
 class GetLastIdentityApplyRequest extends TokenRequest{
-	String? applyPosition;
+	String? applyRoleCode;
 
 	GetLastIdentityApplyRequest({
-		this.applyPosition,
+		this.applyRoleCode,
 		String? token,
 	}) : super(
 			token: token,
@@ -79,15 +79,15 @@ class GetLastIdentityApplyRequest extends TokenRequest{
 
 	factory GetLastIdentityApplyRequest.fromJson(Map<String, dynamic> map) {
 		return GetLastIdentityApplyRequest( 
-			applyPosition: map['ApplyPosition'],
+			applyRoleCode: map['ApplyRoleCode'],
 			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		if(applyPosition != null)
-			map['ApplyPosition'] = applyPosition;
+		if(applyRoleCode != null)
+			map['ApplyRoleCode'] = applyRoleCode;
 		return map;
 	}
 }
@@ -101,7 +101,7 @@ class ApplyForRequest extends IdentityApplyDTO{
 		this.extensionData,
 		String? identityApplyCode,
 		String? userCode,
-		String? applyPosition,
+		String? applyRoleCode,
 		List<String>? identityCard,
 		List<String>? licenseCard,
 		ApplyStateEnum applyState = ApplyStateEnum.NotApply,
@@ -111,7 +111,7 @@ class ApplyForRequest extends IdentityApplyDTO{
 	}) : super(
 			identityApplyCode: identityApplyCode,
 			userCode: userCode,
-			applyPosition: applyPosition,
+			applyRoleCode: applyRoleCode,
 			identityCard: identityCard,
 			licenseCard: licenseCard,
 			applyState: applyState,
@@ -128,7 +128,7 @@ class ApplyForRequest extends IdentityApplyDTO{
 			extensionData: map['ExtensionData'],
 			identityApplyCode: map['IdentityApplyCode'],
 			userCode: map['UserCode'],
-			applyPosition: map['ApplyPosition'],
+			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']),

+ 2 - 0
lib/services/index.dart

@@ -5,6 +5,7 @@ export 'email.dart';
 export 'identityApply.dart';
 export 'login.dart';
 export 'organization.dart';
+export 'patient.dart';
 export 'platform.dart';
 export 'position.dart';
 export 'rank.dart';
@@ -19,6 +20,7 @@ export 'device.m.dart';
 export 'identityApply.m.dart';
 export 'login.m.dart';
 export 'organization.m.dart';
+export 'patient.m.dart';
 export 'platform.m.dart';
 export 'position.m.dart';
 export 'rank.m.dart';

+ 2 - 2
lib/services/organization.dart

@@ -53,12 +53,12 @@ class OrganizationService extends JsonRpcClientBase {
 		return rpcRst;
 	}
 
-	Future<int> addOrganizations(AddOrganizationsRequest request) async {
+	Future<bool> addOrganizations(AddOrganizationsRequest request) async {
 		var rpcRst = await call("AddOrganizations", request);
 		return rpcRst;
 	}
 
-	Future<int> removeOrganizations(RemoveOrganizationsRequest request) async {
+	Future<bool> removeOrganizations(RemoveOrganizationsRequest request) async {
 		var rpcRst = await call("RemoveOrganizations", request);
 		return rpcRst;
 	}

+ 61 - 0
lib/services/patient.dart

@@ -0,0 +1,61 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
+
+import 'patient.m.dart';
+
+
+class PatientService extends JsonRpcClientBase {
+	PatientService(
+		String host, {
+		String serviceName = "IPatientService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => PageResult<PatientInfoBaseDTO>.fromJson(map));
+		FJsonConvert.setDecoder((map) => PatientInfoBaseDTO.fromJson(map));
+		FJsonConvert.setDecoder((map) => PatientInfoDTO.fromJson(map));
+	}
+
+	Future<bool> createPatient(CreatePatientRequest request) async {
+		var rpcRst = await call("CreatePatient", request);
+		return rpcRst;
+	}
+
+	Future<bool> updatePatient(UpdatePatientRequest request) async {
+		var rpcRst = await call("UpdatePatient", request);
+		return rpcRst;
+	}
+
+	Future<bool> createPatients(CreatePatientsRequest request) async {
+		var rpcRst = await call("CreatePatients", request);
+		return rpcRst;
+	}
+
+	Future<PageResult<PatientInfoBaseDTO>> findPatients(FindPatientsPageRequest request) async {
+		var rpcRst = await call("FindPatients", request);
+		var result = PageResult<PatientInfoBaseDTO>.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<PatientInfoDTO> findPatientByCode(FindPatientByCodeRequest request) async {
+		var rpcRst = await call("FindPatientByCode", request);
+		var result = PatientInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<PatientInfoDTO> assignPatientToUsers(AssignPatientToUsersRequest request) async {
+		var rpcRst = await call("AssignPatientToUsers", request);
+		var result = PatientInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+}
+

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

@@ -0,0 +1,489 @@
+import 'authentication.m.dart';
+import 'device.m.dart';
+
+import 'package:fis_jsonrpc/utils.dart';
+
+import 'package:fis_common/json_convert.dart';
+
+class CreatePatientRequest extends TokenRequest{
+	String? name;
+	String? phone;
+	bool identityCard;
+	bool insuranceCode;
+	String? age;
+	bool isMale;
+	bool isValid;
+	String? creatorCode;
+	String? sourceCode;
+
+	CreatePatientRequest({
+		this.name,
+		this.phone,
+		this.identityCard = false,
+		this.insuranceCode = false,
+		this.age,
+		this.isMale = false,
+		this.isValid = false,
+		this.creatorCode,
+		this.sourceCode,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory CreatePatientRequest.fromJson(Map<String, dynamic> map) {
+		return CreatePatientRequest( 
+			name: map['Name'],
+			phone: map['Phone'],
+			identityCard: map['IdentityCard'],
+			insuranceCode: map['InsuranceCode'],
+			age: map['Age'],
+			isMale: map['IsMale'],
+			isValid: map['IsValid'],
+			creatorCode: map['CreatorCode'],
+			sourceCode: map['SourceCode'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(name != null)
+			map['Name'] = name;
+		if(phone != null)
+			map['Phone'] = phone;
+		map['IdentityCard'] = identityCard;
+		map['InsuranceCode'] = insuranceCode;
+		if(age != null)
+			map['Age'] = age;
+		map['IsMale'] = isMale;
+		map['IsValid'] = isValid;
+		if(creatorCode != null)
+			map['CreatorCode'] = creatorCode;
+		if(sourceCode != null)
+			map['SourceCode'] = sourceCode;
+		return map;
+	}
+}
+
+class UpdatePatientRequest extends TokenRequest{
+	String? code;
+	String? name;
+	String? phone;
+	bool identityCard;
+	bool insuranceCode;
+	String? age;
+	bool isMale;
+
+	UpdatePatientRequest({
+		this.code,
+		this.name,
+		this.phone,
+		this.identityCard = false,
+		this.insuranceCode = false,
+		this.age,
+		this.isMale = false,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory UpdatePatientRequest.fromJson(Map<String, dynamic> map) {
+		return UpdatePatientRequest( 
+			code: map['Code'],
+			name: map['Name'],
+			phone: map['Phone'],
+			identityCard: map['IdentityCard'],
+			insuranceCode: map['InsuranceCode'],
+			age: map['Age'],
+			isMale: map['IsMale'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(code != null)
+			map['Code'] = code;
+		if(name != null)
+			map['Name'] = name;
+		if(phone != null)
+			map['Phone'] = phone;
+		map['IdentityCard'] = identityCard;
+		map['InsuranceCode'] = insuranceCode;
+		if(age != null)
+			map['Age'] = age;
+		map['IsMale'] = isMale;
+		return map;
+	}
+}
+
+class UploadPatientDTO {
+	String? name;
+	String? phone;
+	bool identityCard;
+	bool insuranceCode;
+	String? age;
+	bool isMale;
+	bool isValid;
+	String? creatorCode;
+	String? sourceCode;
+
+	UploadPatientDTO({
+		this.name,
+		this.phone,
+		this.identityCard = false,
+		this.insuranceCode = false,
+		this.age,
+		this.isMale = false,
+		this.isValid = false,
+		this.creatorCode,
+		this.sourceCode,
+	});
+
+	factory UploadPatientDTO.fromJson(Map<String, dynamic> map) {
+		return UploadPatientDTO( 
+			name: map['Name'],
+			phone: map['Phone'],
+			identityCard: map['IdentityCard'],
+			insuranceCode: map['InsuranceCode'],
+			age: map['Age'],
+			isMale: map['IsMale'],
+			isValid: map['IsValid'],
+			creatorCode: map['CreatorCode'],
+			sourceCode: map['SourceCode'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(name != null)
+			map['Name'] = name;
+		if(phone != null)
+			map['Phone'] = phone;
+		map['IdentityCard'] = identityCard;
+		map['InsuranceCode'] = insuranceCode;
+		if(age != null)
+			map['Age'] = age;
+		map['IsMale'] = isMale;
+		map['IsValid'] = isValid;
+		if(creatorCode != null)
+			map['CreatorCode'] = creatorCode;
+		if(sourceCode != null)
+			map['SourceCode'] = sourceCode;
+		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? code;
+	String? name;
+	String? phone;
+	bool identityCard;
+	bool insuranceCode;
+	String? age;
+	bool isMale;
+	bool isValid;
+	String? organizationCode;
+
+	PatientInfoBaseDTO({
+		this.code,
+		this.name,
+		this.phone,
+		this.identityCard = false,
+		this.insuranceCode = false,
+		this.age,
+		this.isMale = false,
+		this.isValid = false,
+		this.organizationCode,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory PatientInfoBaseDTO.fromJson(Map<String, dynamic> map) {
+		return PatientInfoBaseDTO( 
+			code: map['Code'],
+			name: map['Name'],
+			phone: map['Phone'],
+			identityCard: map['IdentityCard'],
+			insuranceCode: map['InsuranceCode'],
+			age: map['Age'],
+			isMale: map['IsMale'],
+			isValid: map['IsValid'],
+			organizationCode: map['OrganizationCode'],
+			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(code != null)
+			map['Code'] = code;
+		if(name != null)
+			map['Name'] = name;
+		if(phone != null)
+			map['Phone'] = phone;
+		map['IdentityCard'] = identityCard;
+		map['InsuranceCode'] = insuranceCode;
+		if(age != null)
+			map['Age'] = age;
+		map['IsMale'] = isMale;
+		map['IsValid'] = isValid;
+		if(organizationCode != null)
+			map['OrganizationCode'] = organizationCode;
+		return map;
+	}
+}
+
+class PageResult<T> {
+	int pageIndex;
+	int pageSize;
+	int totalCount;
+	List<T>? pageData;
+
+	PageResult({
+		this.pageIndex = 0,
+		this.pageSize = 0,
+		this.totalCount = 0,
+		this.pageData,
+	});
+
+	factory PageResult.fromJson(Map<String, dynamic> map) {
+		List<T> pageDataList = [];
+		if (map['PageData'] != null) {
+			pageDataList.addAll(
+					(map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
+		}
+		return PageResult( 
+			pageIndex: map['PageIndex'],
+			pageSize: map['PageSize'],
+			totalCount: map['TotalCount'],
+			pageData: pageDataList,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['PageIndex'] = pageIndex;
+		map['PageSize'] = pageSize;
+		map['TotalCount'] = totalCount;
+		if(pageData != null)
+			map['PageData'] = pageData;
+		return map;
+	}
+}
+
+class PageRequest extends TokenRequest{
+	int pageIndex;
+	int pageSize;
+
+	PageRequest({
+		this.pageIndex = 0,
+		this.pageSize = 0,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory PageRequest.fromJson(Map<String, dynamic> map) {
+		return PageRequest( 
+			pageIndex: map['PageIndex'],
+			pageSize: map['PageSize'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		map['PageIndex'] = pageIndex;
+		map['PageSize'] = pageSize;
+		return map;
+	}
+}
+
+class FindPatientsPageRequest extends PageRequest{
+	String? userCode;
+	String? keyWord;
+	DateTime? startTime;
+	DateTime? endTime;
+
+	FindPatientsPageRequest({
+		this.userCode,
+		this.keyWord,
+		this.startTime,
+		this.endTime,
+		int pageIndex = 0,
+		int pageSize = 0,
+		String? token,
+	}) : super(
+			pageIndex: pageIndex,
+			pageSize: pageSize,
+			token: token,
+		);
+
+	factory FindPatientsPageRequest.fromJson(Map<String, dynamic> map) {
+		return FindPatientsPageRequest( 
+			userCode: map['UserCode'],
+			keyWord: map['KeyWord'],
+			startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
+			endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
+			pageIndex: map['PageIndex'],
+			pageSize: map['PageSize'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(userCode != null)
+			map['UserCode'] = userCode;
+		if(keyWord != null)
+			map['KeyWord'] = keyWord;
+		if(startTime != null)
+			map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
+		if(endTime != null)
+			map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
+		return map;
+	}
+}
+
+class PatientInfoDTO extends PatientInfoBaseDTO{
+	List<String>? recordCodes;
+
+	PatientInfoDTO({
+		this.recordCodes,
+		String? code,
+		String? name,
+		String? phone,
+		bool identityCard = false,
+		bool insuranceCode = false,
+		String? age,
+		bool isMale = false,
+		bool isValid = false,
+		String? organizationCode,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			code: code,
+			name: name,
+			phone: phone,
+			identityCard: identityCard,
+			insuranceCode: insuranceCode,
+			age: age,
+			isMale: isMale,
+			isValid: isValid,
+			organizationCode: organizationCode,
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory PatientInfoDTO.fromJson(Map<String, dynamic> map) {
+		return PatientInfoDTO( 
+			recordCodes: map['RecordCodes'] != null ? map['RecordCodes'].cast<String>().toList() : null,
+			code: map['Code'],
+			name: map['Name'],
+			phone: map['Phone'],
+			identityCard: map['IdentityCard'],
+			insuranceCode: map['InsuranceCode'],
+			age: map['Age'],
+			isMale: map['IsMale'],
+			isValid: map['IsValid'],
+			organizationCode: map['OrganizationCode'],
+			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;
+		return map;
+	}
+}
+
+class FindPatientByCodeRequest extends TokenRequest{
+	String? code;
+
+	FindPatientByCodeRequest({
+		this.code,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory FindPatientByCodeRequest.fromJson(Map<String, dynamic> map) {
+		return FindPatientByCodeRequest( 
+			code: map['Code'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(code != null)
+			map['Code'] = code;
+		return map;
+	}
+}
+
+class AssignPatientToUsersRequest extends TokenRequest{
+	String? patientCode;
+	List<String>? userCodes;
+
+	AssignPatientToUsersRequest({
+		this.patientCode,
+		this.userCodes,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory AssignPatientToUsersRequest.fromJson(Map<String, dynamic> map) {
+		return AssignPatientToUsersRequest( 
+			patientCode: map['PatientCode'],
+			userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(patientCode != null)
+			map['PatientCode'] = patientCode;
+		if(userCodes != null)
+			map['UserCodes'] = userCodes;
+		return map;
+	}
+}
+
+

+ 5 - 5
lib/services/position.dart

@@ -28,18 +28,18 @@ class PositionService extends JsonRpcClientBase {
 		return result;
 	}
 
-	Future<int> addPositions(AddPositionsRequest request) async {
+	Future<bool> addPositions(AddPositionsRequest request) async {
 		var rpcRst = await call("AddPositions", request);
 		return rpcRst;
 	}
 
-	Future<int> updatePositions(UpdatePositionsRequest request) async {
-		var rpcRst = await call("UpdatePositions", request);
+	Future<bool> removePositions(RemovePositionRequest request) async {
+		var rpcRst = await call("RemovePositions", request);
 		return rpcRst;
 	}
 
-	Future<int> removePositions(RemovePositionRequest request) async {
-		var rpcRst = await call("RemovePositions", request);
+	Future<bool> updatePositionName(UpdatePositionNameRequest request) async {
+		var rpcRst = await call("UpdatePositionName", request);
 		return rpcRst;
 	}
 

+ 23 - 18
lib/services/position.m.dart

@@ -136,52 +136,57 @@ class AddPositionsRequest {
 	}
 }
 
-class UpdatePositionsRequest extends TokenRequest{
-	List<PositionItemDTO>? positions;
+class RemovePositionRequest extends TokenRequest{
+	List<String>? positionCodes;
 
-	UpdatePositionsRequest({
-		this.positions,
+	RemovePositionRequest({
+		this.positionCodes,
 		String? token,
 	}) : super(
 			token: token,
 		);
 
-	factory UpdatePositionsRequest.fromJson(Map<String, dynamic> map) {
-		return UpdatePositionsRequest( 
-			positions: map['Positions'] != null ? map['Positions'].map((e)=>PositionItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+	factory RemovePositionRequest.fromJson(Map<String, dynamic> map) {
+		return RemovePositionRequest( 
+			positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
 			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		if(positions != null)
-			map['Positions'] = positions;
+		if(positionCodes != null)
+			map['PositionCodes'] = positionCodes;
 		return map;
 	}
 }
 
-class RemovePositionRequest extends TokenRequest{
-	List<String>? positionCodes;
+class UpdatePositionNameRequest extends TokenRequest{
+	String? positionCode;
+	String? positionName;
 
-	RemovePositionRequest({
-		this.positionCodes,
+	UpdatePositionNameRequest({
+		this.positionCode,
+		this.positionName,
 		String? token,
 	}) : super(
 			token: token,
 		);
 
-	factory RemovePositionRequest.fromJson(Map<String, dynamic> map) {
-		return RemovePositionRequest( 
-			positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
+	factory UpdatePositionNameRequest.fromJson(Map<String, dynamic> map) {
+		return UpdatePositionNameRequest( 
+			positionCode: map['PositionCode'],
+			positionName: map['PositionName'],
 			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		if(positionCodes != null)
-			map['PositionCodes'] = positionCodes;
+		if(positionCode != null)
+			map['PositionCode'] = positionCode;
+		if(positionName != null)
+			map['PositionName'] = positionName;
 		return map;
 	}
 }

+ 4 - 4
lib/services/rank.dart

@@ -34,18 +34,18 @@ class RankService extends JsonRpcClientBase {
 		return result;
 	}
 
-	Future<int> addRanks(AddRanksRequest request) async {
+	Future<bool> addRanks(AddRanksRequest request) async {
 		var rpcRst = await call("AddRanks", request);
 		return rpcRst;
 	}
 
-	Future<int> removeRanks(RemoveRanksRequest request) async {
+	Future<bool> removeRanks(RemoveRanksRequest request) async {
 		var rpcRst = await call("RemoveRanks", request);
 		return rpcRst;
 	}
 
-	Future<int> updateRanks(UpdateRanksRequest request) async {
-		var rpcRst = await call("UpdateRanks", request);
+	Future<bool> updateRankName(UpdateRankNameRequest request) async {
+		var rpcRst = await call("UpdateRankName", request);
 		return rpcRst;
 	}
 

+ 14 - 9
lib/services/rank.m.dart

@@ -175,27 +175,32 @@ class RemoveRanksRequest extends TokenRequest{
 	}
 }
 
-class UpdateRanksRequest extends TokenRequest{
-	List<RankItemDTO>? ranks;
+class UpdateRankNameRequest extends TokenRequest{
+	String? rankCode;
+	String? rankName;
 
-	UpdateRanksRequest({
-		this.ranks,
+	UpdateRankNameRequest({
+		this.rankCode,
+		this.rankName,
 		String? token,
 	}) : super(
 			token: token,
 		);
 
-	factory UpdateRanksRequest.fromJson(Map<String, dynamic> map) {
-		return UpdateRanksRequest( 
-			ranks: map['Ranks'] != null ? map['Ranks'].map((e)=>RankItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+	factory UpdateRankNameRequest.fromJson(Map<String, dynamic> map) {
+		return UpdateRankNameRequest( 
+			rankCode: map['RankCode'],
+			rankName: map['RankName'],
 			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		if(ranks != null)
-			map['Ranks'] = ranks;
+		if(rankCode != null)
+			map['RankCode'] = rankCode;
+		if(rankName != null)
+			map['RankName'] = rankName;
 		return map;
 	}
 }

+ 48 - 16
lib/services/role.m.dart

@@ -1,6 +1,44 @@
 import 'device.m.dart';
 import 'authentication.m.dart';
 
+class BaseRoleDTO extends BaseDTO{
+	String? roleCode;
+	String? roleName;
+	String? description;
+
+	BaseRoleDTO({
+		this.roleCode,
+		this.roleName,
+		this.description,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory BaseRoleDTO.fromJson(Map<String, dynamic> map) {
+		return BaseRoleDTO( 
+			roleCode: map['RoleCode'],
+			roleName: map['RoleName'],
+			description: map['Description'],
+			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(roleCode != null)
+			map['RoleCode'] = roleCode;
+		if(roleName != null)
+			map['RoleName'] = roleName;
+		if(description != null)
+			map['Description'] = description;
+		return map;
+	}
+}
+
 enum RoleShowTypeEnum {
 	NotShow,
 	ISShow,
@@ -13,11 +51,8 @@ enum RoleQualificationEnum {
 	Both,
 }
 
-class RoleDTO extends BaseDTO{
-	String? roleCode;
-	String? roleName;
+class RoleDTO extends BaseRoleDTO{
 	RoleShowTypeEnum roleShowType;
-	String? description;
 	String? iConUrl;
 	String? colorStart;
 	String? colorEnd;
@@ -25,33 +60,36 @@ class RoleDTO extends BaseDTO{
 	String? userGroupCode;
 
 	RoleDTO({
-		this.roleCode,
-		this.roleName,
 		this.roleShowType = RoleShowTypeEnum.NotShow,
-		this.description,
 		this.iConUrl,
 		this.colorStart,
 		this.colorEnd,
 		this.roleQualification = RoleQualificationEnum.NoNeed,
 		this.userGroupCode,
+		String? roleCode,
+		String? roleName,
+		String? description,
 		DateTime? createTime,
 		DateTime? updateTime,
 	}) : super(
+			roleCode: roleCode,
+			roleName: roleName,
+			description: description,
 			createTime: createTime,
 			updateTime: updateTime,
 		);
 
 	factory RoleDTO.fromJson(Map<String, dynamic> map) {
 		return RoleDTO( 
-			roleCode: map['RoleCode'],
-			roleName: map['RoleName'],
 			roleShowType: RoleShowTypeEnum.values.firstWhere((e) => e.index == map['RoleShowType']),
-			description: map['Description'],
 			iConUrl: map['IConUrl'],
 			colorStart: map['ColorStart'],
 			colorEnd: map['ColorEnd'],
 			roleQualification: RoleQualificationEnum.values.firstWhere((e) => e.index == map['RoleQualification']),
 			userGroupCode: map['UserGroupCode'],
+			roleCode: map['RoleCode'],
+			roleName: map['RoleName'],
+			description: map['Description'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
 			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
 		);
@@ -59,13 +97,7 @@ class RoleDTO extends BaseDTO{
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		if(roleCode != null)
-			map['RoleCode'] = roleCode;
-		if(roleName != null)
-			map['RoleName'] = roleName;
 		map['RoleShowType'] = roleShowType.index;
-		if(description != null)
-			map['Description'] = description;
 		if(iConUrl != null)
 			map['IConUrl'] = iConUrl;
 		if(colorStart != null)

+ 3 - 1
lib/services/user.dart

@@ -5,6 +5,8 @@ import 'package:fis_common/json_convert.dart';
 
 import 'user.m.dart';
 
+import 'patient.m.dart';
+
 
 class UserService extends JsonRpcClientBase {
 	UserService(
@@ -41,7 +43,7 @@ class UserService extends JsonRpcClientBase {
 		return result;
 	}
 
-	Future<int> removeUsersFromOrganization(RemoveUsersFromOrganizationRequest request) async {
+	Future<bool> removeUsersFromOrganization(RemoveUsersFromOrganizationRequest request) async {
 		var rpcRst = await call("RemoveUsersFromOrganization", request);
 		return rpcRst;
 	}

+ 63 - 150
lib/services/user.m.dart

@@ -1,8 +1,7 @@
 import 'device.m.dart';
 import 'identityApply.m.dart';
 import 'authentication.m.dart';
-
-import 'package:fis_common/json_convert.dart';
+import 'patient.m.dart';
 
 enum UserInfoStateEnum {
 	Nonactivated,
@@ -28,6 +27,8 @@ class UserDTO extends BaseDTO{
 	List<String>? rankCodes;
 	List<String>? positionCodes;
 	ApplyStateEnum applyState;
+	String? rankName;
+	String? positionName;
 
 	UserDTO({
 		this.userCode,
@@ -48,6 +49,8 @@ class UserDTO extends BaseDTO{
 		this.rankCodes,
 		this.positionCodes,
 		this.applyState = ApplyStateEnum.NotApply,
+		this.rankName,
+		this.positionName,
 		DateTime? createTime,
 		DateTime? updateTime,
 	}) : super(
@@ -75,6 +78,8 @@ class UserDTO extends BaseDTO{
 			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'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
 			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
 		);
@@ -115,6 +120,10 @@ class UserDTO extends BaseDTO{
 		if(positionCodes != null)
 			map['PositionCodes'] = positionCodes;
 		map['ApplyState'] = applyState.index;
+		if(rankName != null)
+			map['RankName'] = rankName;
+		if(positionName != null)
+			map['PositionName'] = positionName;
 		return map;
 	}
 }
@@ -139,104 +148,75 @@ class GetUserInfoRequest extends TokenRequest{
 	}
 }
 
-class AlterUserInfoRequest extends UserDTO{
-	String? token;
+class AlterUserInfoRequest extends TokenRequest{
+	String? phone;
+	String? email;
+	String? nickName;
+	String? fullName;
+	String? headImageUrl;
+	String? organizationCode;
 	String? extensionData;
 
 	AlterUserInfoRequest({
-		this.token,
+		this.phone,
+		this.email,
+		this.nickName,
+		this.fullName,
+		this.headImageUrl,
+		this.organizationCode,
 		this.extensionData,
-		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,
-		DateTime? createTime,
-		DateTime? updateTime,
+		String? token,
 	}) : 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,
-			createTime: createTime,
-			updateTime: updateTime,
+			token: token,
 		);
 
 	factory AlterUserInfoRequest.fromJson(Map<String, dynamic> map) {
 		return AlterUserInfoRequest( 
-			token: map['Token'],
-			extensionData: map['ExtensionData'],
-			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']),
-			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
-			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
+			extensionData: map['ExtensionData'],
+			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		if(token != null)
-			map['Token'] = token;
+		if(phone != null)
+			map['Phone'] = phone;
+		if(email != null)
+			map['Email'] = email;
+		if(nickName != null)
+			map['NickName'] = nickName;
+		if(fullName != null)
+			map['FullName'] = fullName;
+		if(headImageUrl != null)
+			map['HeadImageUrl'] = headImageUrl;
+		if(organizationCode != null)
+			map['OrganizationCode'] = organizationCode;
 		if(extensionData != null)
 			map['ExtensionData'] = extensionData;
 		return map;
 	}
 }
 
+enum GetUserListTypeEnum {
+	FullName,
+	Position,
+	Phone,
+	Rank,
+}
+
 class GetUserListRequest extends TokenRequest{
-	String? roleCode;
-	String? rankCode;
-	String? positionCode;
-	String? organizationCode;
+	GetUserListTypeEnum queryType;
+	String? keyword;
 
 	GetUserListRequest({
-		this.roleCode,
-		this.rankCode,
-		this.positionCode,
-		this.organizationCode,
+		this.queryType = GetUserListTypeEnum.FullName,
+		this.keyword,
 		String? token,
 	}) : super(
 			token: token,
@@ -244,24 +224,17 @@ class GetUserListRequest extends TokenRequest{
 
 	factory GetUserListRequest.fromJson(Map<String, dynamic> map) {
 		return GetUserListRequest( 
-			roleCode: map['RoleCode'],
-			rankCode: map['RankCode'],
-			positionCode: map['PositionCode'],
-			organizationCode: map['OrganizationCode'],
+			queryType: GetUserListTypeEnum.values.firstWhere((e) => e.index == map['QueryType']),
+			keyword: map['Keyword'],
 			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = super.toJson();
-		if(roleCode != null)
-			map['RoleCode'] = roleCode;
-		if(rankCode != null)
-			map['RankCode'] = rankCode;
-		if(positionCode != null)
-			map['PositionCode'] = positionCode;
-		if(organizationCode != null)
-			map['OrganizationCode'] = organizationCode;
+		map['QueryType'] = queryType.index;
+		if(keyword != null)
+			map['Keyword'] = keyword;
 		return map;
 	}
 }
@@ -359,6 +332,8 @@ class AlterPersonInfoRequest extends UserDTO{
 		List<String>? rankCodes,
 		List<String>? positionCodes,
 		ApplyStateEnum applyState = ApplyStateEnum.NotApply,
+		String? rankName,
+		String? positionName,
 		DateTime? createTime,
 		DateTime? updateTime,
 	}) : super(
@@ -380,6 +355,8 @@ class AlterPersonInfoRequest extends UserDTO{
 			rankCodes: rankCodes,
 			positionCodes: positionCodes,
 			applyState: applyState,
+			rankName: rankName,
+			positionName: positionName,
 			createTime: createTime,
 			updateTime: updateTime,
 		);
@@ -405,6 +382,8 @@ class AlterPersonInfoRequest extends UserDTO{
 			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'],
 			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
 			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
 		);
@@ -476,73 +455,7 @@ class ShareDeviceUserDTO extends BaseDTO{
 	}
 }
 
-class PageResult<T> {
-	int pageIndex;
-	int pageSize;
-	int totalCount;
-	List<T>? pageData;
-
-	PageResult({
-		this.pageIndex = 0,
-		this.pageSize = 0,
-		this.totalCount = 0,
-		this.pageData,
-	});
-
-	factory PageResult.fromJson(Map<String, dynamic> map) {
-		List<T> pageDataList = [];
-		if (map['PageData'] != null) {
-			pageDataList.addAll(
-					(map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
-		}
-		return PageResult( 
-			pageIndex: map['PageIndex'],
-			pageSize: map['PageSize'],
-			totalCount: map['TotalCount'],
-			pageData: pageDataList,
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		map['PageIndex'] = pageIndex;
-		map['PageSize'] = pageSize;
-		map['TotalCount'] = totalCount;
-		if(pageData != null)
-			map['PageData'] = pageData;
-		return map;
-	}
-}
-
-class PageRequest2 extends TokenRequest{
-	int pageIndex;
-	int pageSize;
-
-	PageRequest2({
-		this.pageIndex = 0,
-		this.pageSize = 0,
-		String? token,
-	}) : super(
-			token: token,
-		);
-
-	factory PageRequest2.fromJson(Map<String, dynamic> map) {
-		return PageRequest2( 
-			pageIndex: map['PageIndex'],
-			pageSize: map['PageSize'],
-			token: map['Token'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = super.toJson();
-		map['PageIndex'] = pageIndex;
-		map['PageSize'] = pageSize;
-		return map;
-	}
-}
-
-class GetShareDeviceUsersPageRequest extends PageRequest2{
+class GetShareDeviceUsersPageRequest extends PageRequest{
 	String? deviceCode;
 
 	GetShareDeviceUsersPageRequest({