From 8badb57ea2c82557850ad5b39281c3e8714eb119 Mon Sep 17 00:00:00 2001
From: liuyan <liuyan@prec-tech.com>
Date: 星期四, 24 十一月 2022 10:08:31 +0800
Subject: [PATCH] 科室信息漏传SPO问题
---
force-app/main/default/classes/NFM624RestAbout.cls | 58 ++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 42 insertions(+), 16 deletions(-)
diff --git a/force-app/main/default/classes/NFM624RestAbout.cls b/force-app/main/default/classes/NFM624RestAbout.cls
index fed64f7..8011d0b 100644
--- a/force-app/main/default/classes/NFM624RestAbout.cls
+++ b/force-app/main/default/classes/NFM624RestAbout.cls
@@ -16,10 +16,10 @@
global class GeDatas {
public NFMUtil.Monitoring Monitoring;
public GeData[] GeData;
- }
- global class GeData{
+ }
+ global class GeData{
- public String PersonManagementCode; //浜哄憳绠$悊缂栫爜
+ public String PersonManagementCode; //浜哄憳绠$悊缂栫爜
public String HospitalManagementCode2; //鍖婚櫌骞冲彴缂栫爜 骞冲彴缂栫爜 PlatformCode__c
public String DepartmentManagementCode2; //绉戝骞冲彴缂栫爜 骞冲彴缂栫爜 PlatformCode__c
//public String Name; //濮撳悕
@@ -29,7 +29,7 @@
public String DepartmentName; //鎵�灞炵瀹�
public String RelatedDepartment; //鍏宠仈SFDC绉戝 瀹㈡埛绠$悊缂栫爜(鎵嬪啓) AgentCode_Ext__c
//public Boolean AgentFlag; //缁忛攢鍟嗘爣璇�
- public String dataId;
+ public String dataId;
public String AccountName; //鍖婚櫌鍚�
public String MobileEncrypted; //鐢佃瘽瀵嗘枃 add 20220519 thh
}
@@ -39,11 +39,11 @@
global class Response {
public List<ResponseDetail> ResponseDetails {get;set;}
}
-
+
global class ResponseDetail{
- public String dataId;
- public String awsDataId; //=CONTACT.AWS_Data_Id__c
- public String sfId;
+ public String dataId;
+ public String awsDataId; //=CONTACT.AWS_Data_Id__c
+ public String sfId;
}
@HttpPost
@@ -201,8 +201,8 @@
//AccountId
from Contact
where CManageCode__c IN: PersonManagementCodeList
- OR (Account.Parent_PlatformCode__c IN: ManagementList AND LastName_Encrypted__c IN:NameList)
- OR (Account.Parent_Management_Code__c IN: SFDCCodeList AND LastName_Encrypted__c IN:NameList )
+ OR (Account.Parent_PlatformCode__c IN: ManagementList AND LastName_Encrypted__c IN:NameList AND UnifiedI_Contact_ID__c = null)
+ OR (Account.Parent_Management_Code__c IN: SFDCCodeList AND LastName_Encrypted__c IN:NameList AND UnifiedI_Contact_ID__c = null)
ORDER BY MobilePhone ASC,CManageCode__c ASC]; //鏍规嵁浜哄憳绠$悊缂栫爜妫�绱㈣仈绯讳汉
Map < String, Contact > peopleMap = new Map < String, Contact > (); //鑱旂郴浜�
system.debug('peopleList '+peopleList);
@@ -211,12 +211,15 @@
Map < String, Contact > snameMap = new Map < String, Contact > ();
string namekey;
string nameKey2;
+ string nameKey3;
if(String.isBlank(ct.MobilePhone_Encrypted__c)){
namekey = ct.Account.Name + ' ' + ct.LastName_Encrypted__c.trim();
nameKey2 = ct.Account.Management_Code__c + ' ' + ct.LastName_Encrypted__c.trim();
+ nameKey3 = ct.LastName_Encrypted__c.trim();
} else{
namekey = ct.Account.Name + ' ' + ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim();
nameKey2 = ct.Account.Management_Code__c + ' ' + ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim();
+ nameKey3 = ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim();
}
snameMap.put(namekey,ct);
if (nameMap.containsKey(ct.Account.parent.Name)) {
@@ -224,6 +227,7 @@
}
snameMap.put(nameKey2,ct);
snameMap.put(namekey, ct);
+ snameMap.put(namekey3, ct);
// // 閫氳繃濮撳悕+鎵嬫満鍙峰垽鏂汉鍛樻槸鍚﹂噸澶� thh 20220518 start
// System.System.debug('ct.MobilePhone_Encrypted__c1:' + ct.MobilePhone_Encrypted__c);
// if(String.isBlank(ct.MobilePhone_Encrypted__c)){
@@ -238,6 +242,7 @@
}
peopleMap.put(ct.CManageCode__c, ct);
System.debug('peopleMap'+peopleMap);
+ System.debug('nameMap111'+nameMap);
}
for (Gedata gedata: newGeDataList) {
String personCode = gedata.PersonManagementCode;
@@ -263,6 +268,8 @@
//鏃犱汉鍛樼鐞嗙紪鐮�
string namekey = gedata.RelatedDepartment + ' ' + gedata.NameEncrypted + ' ' + gedata.MobileEncrypted;
string namekey1 = gedata.RelatedDepartment + ' ' + gedata.NameEncrypted;
+ string namekey2 = gedata.NameEncrypted + ' ' + gedata.MobileEncrypted;
+ string namekey3 = gedata.NameEncrypted;
system.debug('DepartmentClasskey = '+DepartmentClasskey);
system.debug('nameMap22222222 '+nameMap);
if (nameMap.containskey(DepartmentClasskey)) {
@@ -271,7 +278,7 @@
System.debug('sMap'+sMap);
System.debug('sMap.containsKey(namekey)'+sMap.containsKey(namekey));
System.debug('Namekey'+namekey);
- if (sMap.containsKey(namekey)) {
+ if (sMap.containsKey(namekey) && sMap.get(namekey).UnifiedI_Contact_ID__c == null) {
system.debug('鏍规嵁鍚嶅瓧鍖归厤瀛樺湪');
red.awsDataId = sMap.get(namekey).AWS_Data_Id__c;
red.sfid = sMap.get(namekey).id;
@@ -280,22 +287,41 @@
red.sfid = sMap.get(namekey1).id;
// // 閫氳繃濮撳悕+鎵嬫満鍙峰垽鏂汉鍛樻槸鍚﹂噸澶� thh 20220518 start
- // } else if(sMap.containsKey(gedata.NameEncrypted + gedata.MobileEncrypted) && sMap.get(gedata.NameEncrypted + gedata.MobileEncrypted).UnifiedI_Contact_ID__c == null){
- // red.awsDataId = sMap.get(gedata.NameEncrypted + gedata.MobileEncrypted).AWS_Data_Id__c;
- // red.sfid = sMap.get(gedata.NameEncrypted + gedata.MobileEncrypted).id;
+ } else if(sMap.containsKey(namekey2) && sMap.get(namekey2).UnifiedI_Contact_ID__c == null){
+ system.debug('鎴樼暐绉戝瀛樺湪绉戝涓虹┖鐢佃瘽鏈夊��');
+ red.awsDataId = sMap.get(namekey2).AWS_Data_Id__c;
+ red.sfid = sMap.get(namekey2).id;
+ }else if(sMap.containsKey(namekey3) && sMap.get(namekey3).UnifiedI_Contact_ID__c == null){
+ system.debug('鎴樼暐绉戝瀛樺湪绉戝涓虹┖鐢佃瘽鏃犲��');
+ red.awsDataId = sMap.get(namekey3).AWS_Data_Id__c;
+ red.sfid = sMap.get(namekey3).id;
// // 閫氳繃濮撳悕+鎵嬫満鍙峰垽鏂汉鍛樻槸鍚﹂噸澶� thh 20220518 end
}else { // 7 瀹屾垚
system.debug('鏍规嵁鍚嶅瓧鍖归厤涓嶅瓨鍦�');
//red.dataID = gedata.dataID;
//red.awsDataId = null;
//red.sfid = null;
+ for ( Integer i = 0; i < peopleList.size(); i++) {
+ if (peopleList[i].Account.parent.Name !=DepartmentClasskey && peopleList[i].MobilePhone_Encrypted__c ==null) {
+ red.awsDataId =peopleList[i].AWS_Data_Id__c;
+ red.sfid =peopleList[i].id;
+ }
+ }
}
system.debug('red----------->'+red);
- responseList.ResponseDetails.add(red);
+ //responseList.ResponseDetails.add(red);
system.debug('responseList.ResponseDetails'+responseList.ResponseDetails);
}else{
- responseList.ResponseDetails.add(red);
+ system.debug('鎴樼暐绉戝涓嶅瓨鍦�');
+ for ( Integer i = 0; i < peopleList.size(); i++) {
+ if (peopleList[i].MobilePhone_Encrypted__c ==null) {
+ red.awsDataId =peopleList[i].AWS_Data_Id__c;
+ red.sfid =peopleList[i].id;
+ }
+ }
+ //responseList.ResponseDetails.add(red);
}
+ responseList.ResponseDetails.add(red);
}
}
}
--
Gitblit v1.9.1