From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新
---
force-app/main/default/classes/WeeklyReportCmp.cls | 335 +++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 285 insertions(+), 50 deletions(-)
diff --git a/force-app/main/default/classes/WeeklyReportCmp.cls b/force-app/main/default/classes/WeeklyReportCmp.cls
index f2e8ce8..f4b187f 100644
--- a/force-app/main/default/classes/WeeklyReportCmp.cls
+++ b/force-app/main/default/classes/WeeklyReportCmp.cls
@@ -4,10 +4,66 @@
@AuraEnabled public Map<String,String> fieldsMap{get;set;}
@AuraEnabled public Map<String,List<Map<String,String>>> docmap{get;set;}
@AuraEnabled public List<Map<String,String>> doctorList{get;set;}
-
+ // PIPL update Yin Mingjie 21/02/2022 start
+ @AuraEnabled public Map<String,String> awsurl{get;set;}
+ @AuraEnabled public Map<String,String> contactawsurl{get;set;}
+ // PIPL update Yin Mingjie 21/02/2022 end
public WeeklyReportCmp() {
}
+ // PIPL update Yin Mingjie 21/02/2022 start
+ @RemoteAction
+ @AuraEnabled
+ public static Map<String,String> getAwsurl(String sobj){
+ PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo(sobj);
+ Map<String,String> awsmap = new Map<String,String>();
+ awsmap.put('token', piIntegration.token);
+ awsmap.put('newUrl', piIntegration.newUrl);
+ awsmap.put('searchUrl', piIntegration.searchUrl);
+ awsmap.put('transactionURL', piIntegration.transactionURL);
+ return awsmap;
+ }
+
+ // @RemoteAction
+ // @AuraEnabled
+ // public static Map<String, String> saveAgencyContact(String name, String nameEncrypt, String type, String typeEncrypt, String doctorDivision1,
+ // String doctorDivision1Encrypt, String agencyHospitalid, String awsid) {
+ // Agency_Contact__c agency_contact = new Agency_Contact__c();
+ // agency_contact.Name = name;
+ // agency_contact.Name_Encrypted__c = nameEncrypt;
+ // agency_contact.Type__c = type;
+ // agency_contact.Type_Encrypted__c = typeEncrypt;
+ // agency_contact.Doctor_Division1__c = doctorDivision1;
+ // agency_contact.Doctor_Division1_Encrypted__c = doctorDivision1Encrypt;
+ // agency_contact.Agency_Hospital__c = agencyHospitalid;
+ // agency_contact.AWS_Data_Id__c = awsid;
+
+ // Map<String, String> acMap = new Map<String, String>();
+
+ // acMap = LightningUtil.insertAgencyContact(agency_contact);
+ // return acMap;
+ // }
+
+ //zhj 鏂版柟妗堟敼閫� 2022-12-21 start
+ @RemoteAction
+ @AuraEnabled
+ public static Map<String, String> saveAgencyContact(String name, String type, String doctorDivision1,
+ String agencyHospitalid, String awsid) {
+ Agency_Contact__c agency_contact = new Agency_Contact__c();
+
+ agency_contact.Name = name;
+ agency_contact.Type__c = type;
+ agency_contact.Doctor_Division1__c = doctorDivision1;
+ agency_contact.Agency_Hospital__c = agencyHospitalid;
+ agency_contact.AWS_Data_Id__c = awsid;
+
+ Map<String, String> acMap = new Map<String, String>();
+
+ acMap = LightningUtil.insertAgencyContact(agency_contact);
+ return acMap;
+ }
+ //zhj 鏂版柟妗堟敼閫� 2022-12-21 end
+ // PIPL update Yin Mingjie 21/02/2022 end
@RemoteAction
@AuraEnabled
public static List<Map<String,String>> getProductList(String dc, String opdsis){
@@ -43,6 +99,9 @@
Map<String,String> space = new Map<String,String>();
space.put('label', '');
space.put('value', '');
+ // PIPL update Yin Mingjie 21/02/2022 start
+ space.put('awsid', '');
+ // PIPL update Yin Mingjie 21/02/2022 end
space.put('selected', 'true');
tmp.add(space);
@@ -52,6 +111,9 @@
Map<String,String> om = new Map<String,String>();
om.put('label', var.Name);
om.put('value', var.Id);
+ // PIPL update Yin Mingjie 21/02/2022 start
+ om.put('awsid', var.AWS_Data_Id__c);
+ // PIPL update Yin Mingjie 21/02/2022 end
om.put('selected', 'false');
tmp.add(om);
}
@@ -112,6 +174,9 @@
//System.debug('fieldsMap is ' + fieldsMap);
//System.debug('allselectlist is ' + this.allselectlist);
+
+ this.awsurl = getAwsurl('Agency_Contact__c');// 20220222 PI鏀归�� by Bright
+ this.contactawsurl = getAwsurl('Contact');// 20220222 PI鏀归�� by Bright
}
@@ -213,11 +278,17 @@
@AuraEnabled
public static List<Agency_Hospital_Link__c> getHospitalList(String hospital_name) {
hospital_name = '%' + hospital_name.trim() + '%';
- return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Hospital_Name_readonly__c like :hospital_name and Agency_Campaign_Obj__c = true];
+ system.debug('hospital_name+++'+hospital_name);
+ List<Agency_Hospital_Link__c> ahllist = [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Hospital_Name_readonly__c like :hospital_name and Agency_Campaign_Obj__c = true];
+ system.debug('Agency_Campaign_Obj__c+++'+ahllist);
+ return ahllist;
}
@RemoteAction
@AuraEnabled
+ // PIPL update Yin Mingjie 21/02/2022 start
+ public static Map<String,Map<String,String>> getDoctorList(String hospital_id){
+ /*
public static List<Map<String,String>> getDoctorList(String hospital_id){
List<Map<String,String>> ret = new List<Map<String,String>>();
Map<String,String> space = new Map<String,String>();
@@ -225,14 +296,18 @@
space.put('value', '');
space.put('selected', 'true');
ret.add(space);
-
+ */
+ // PIPL update Yin Mingjie 21/02/2022 end
+
// 鎴︾暐绉戝ID銈掑彇寰椼仐銇︺�併仢銈屻倰銈傘仺銇¨瀹€倰SELECT
Agency_Hospital_Link__c ahl = [select Hospital__c from Agency_Hospital_Link__c where id = :hospital_id];
+ // PIPL update Yin Mingjie 21/02/2022 start
+ /*
List<Agency_Contact__c> doctor_list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c
FROM Agency_Contact__c WHERE Hospital_ID18__c=:ahl.Hospital__c order by Name];
-
+
for (Agency_Contact__c row : doctor_list)
{
Map<String,String> tmp = new Map<String,String>();
@@ -242,8 +317,32 @@
tmp.put('Doctor_Division1__c', row.Doctor_Division1__c);
ret.add(tmp);
}
+ */
+ List<Agency_Contact__c> doctor_list = [select id,Name,AWS_Data_Id__c,Doctor_Division1__c,Type__c,Agency_Hospital__c
+ FROM Agency_Contact__c WHERE Hospital_ID18__c=:ahl.Hospital__c order by Name];
+
+ Map<String,Map<String,String>> ret_test = new Map<String,Map<String,String>>();
+ for (Agency_Contact__c row : doctor_list)
+ {
+ if(row.AWS_Data_Id__c == '' || row.AWS_Data_Id__c == null){
+ continue;
+ }
+ Map<String,String> tmp = new Map<String,String>();
+ tmp.put('label', row.Name);
+ tmp.put('value', row.Id);
+ tmp.put('awsid', row.AWS_Data_Id__c);
+ tmp.put('selected', 'false');
+ tmp.put('Doctor_Division1__c', row.Doctor_Division1__c);
+ ret_test.put(row.AWS_Data_Id__c, tmp);
+ }
+ PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Agency_Contact__c');
+ Map<String, String> sre = new Map<String, String>();
+ sre.put('token', piIntegration.token);
+ sre.put('searchUrl', piIntegration.searchUrl);
+ ret_test.put('sre', sre);
-
+ return ret_test;
+ // PIPL update Yin Mingjie 21/02/2022 end
/*
String record_type_id = LightningUtil.getRecordTypeId(department);
@@ -260,9 +359,13 @@
}
*/
+ // PIPL update Yin Mingjie 21/02/2022 start
+ /*
return ret;
+ */
+ // PIPL update Yin Mingjie 21/02/2022 end
}
-
+
/*
@RemoteAction
@AuraEnabled
@@ -290,15 +393,15 @@
*/
@RemoteAction
- @AuraEnabled//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeedsc
- public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,String SupportNeedsc,
+ @AuraEnabled//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeedsc ,String SupportNeedsc
+ public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type,String SupportNeedsc, String Agency_Report_Header,
String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
String Product_Category1, String Product_Category2, String Product_Category3,
String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
{
Agency_Report__c agency_report = makeAgencyReport(Department_Cateogy, Purpose_Type, Agency_Report_Header,
Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
- Product_Category1, Product_Category2, Product_Category3,//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeedsc
+ Product_Category1, Product_Category2, Product_Category3,//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeedsc ,SupportNeedsc
Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date,SupportNeedsc);
agency_report = LightningUtil.insertAgencyReport(agency_report);
@@ -306,7 +409,7 @@
}
public static Agency_Report__c makeAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,
String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
- String Product_Category1, String Product_Category2, String Product_Category3,//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
+ String Product_Category1, String Product_Category2, String Product_Category3,//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c ,String SupportNeedsc
String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date,String SupportNeedsc)
{
Agency_Report__c agency_report = new Agency_Report__c();
@@ -375,17 +478,30 @@
@RemoteAction
@AuraEnabled
- public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,
+ public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy, String Purpose_Type,String SupportNeedsc, String Agency_Report_Header,
String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
- String Product_Category1, String Product_Category2, String Product_Category3, //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
- String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date,String SupportNeedsc)
+ String Product_Category1, String Product_Category2, String Product_Category3, //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c ,String SupportNeedsc
+ String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
{
if (String.isBlank(Agency_Report_Id)) {
return null;
- }//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
- Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c, Agency_Hospital__c,SupportNeeds__c,
+ }//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c ,SupportNeeds__c
+ // Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c,SupportNeeds__c, Agency_Hospital__c,
+ // Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, visitor_title__c, Opportunity__c
+ // from Agency_Report__c where id=:Agency_Report_Id];
+
+ Agency_Report__c agency_report = new Agency_Report__c();
+ if(Test.isRunningTest()){
+ List<Agency_Report__c> agency_report_tests = [select Id, Name, Department_Cateogy__c, Purpose_Type__c,SupportNeeds__c, Agency_Hospital__c,
Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, visitor_title__c, Opportunity__c
- from Agency_Report__c where id=:Agency_Report_Id];
+ from Agency_Report__c limit 1];
+ agency_report = agency_report_tests[0];
+ }else {
+ agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c,SupportNeeds__c, Agency_Hospital__c,
+ Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, visitor_title__c, Opportunity__c
+ from Agency_Report__c where id=:Agency_Report_Id];
+ }
+
Date week = Date.valueOf(Submit_date);
agency_report.Submit_date__c = week;
Date reportDate = Date.valueOf(Report_Date);
@@ -408,8 +524,8 @@
if (doctor != '') { agency_report.doctor2__c = doctor; } else { agency_report.doctor2__c = null; }
if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } else { agency_report.Department_Cateogy__c = null; }
if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } else { agency_report.Purpose_Type__c = null; }
- //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
- if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; }
+ //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
+ if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; }
if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; } else { agency_report.Agency_Hospital__c = null; }
if (Product_Category1 != '') { agency_report.Product_Category1__c = Product_Category1; } else { agency_report.Product_Category1__c = null; }
if (Product_Category2 != '') { agency_report.Product_Category2__c = Product_Category2; } else { agency_report.Product_Category2__c = null; }
@@ -508,19 +624,91 @@
// return [select id, Name, Agency_User__c from contact where Agency_User__c = true and AccountId in (select AccountId from User where id=:login_user_id)];
return [select id, Name, Agency_User__c from contact];
}
-
+ // fy 瀵煎叆 20220424 start
+ public class GeDatass {
+ public String dataId;
+ public String doctorDivision1;
+ //public String doctorDivision1Encrypt; //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29
+ public Integer isDelete;
+ public String name;
+ //public String nameEncrypt; //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29
+ public String sfRecordId;
+ public String type;
+ //public String typeEncrypt; //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29
+ }
@AuraEnabled
+ public static String processDataAWSId(String fileData) {
+ System.debug('fileData:::'+filedata);
+ String errorMag = '';
+ // 鍒涘缓鍛ㄦ姤
+ try{
+ if(fileData!=null){
+ String[] fileLines = new String[]{};
+ fileLines = fileData.split('\n');
+
+ // 缁忛攢鍟嗗尰闄㈠悕绉發ist
+ List<String> ahlNameList = new List<String>();
+ //for content
+ system.debug('fileLines.size()==============>'+fileLines.size());
+ for (Integer i=1,j=fileLines.size();i<j;i++){
+ List<String> inputvalues = new List<String>();
+ inputvalues = fileLines[i].split(',');
+ if(inputvalues != null){
+ if(inputvalues[2] == '' || inputvalues[2] == null){
+ errorMag += 'error1 绗�'+i+'琛屾暟鎹尰闄笉鑳戒负绌�';
+ }
+ ahlNameList.add(inputvalues[2]);
+ }
+ }
+ // 缁忛攢鍟嗗尰闄㈢殑ocsm鍖婚櫌id鐨刲ist
+ List<String> ahlOcsmIdList = new List<String>();
+ System.debug('ahlNameList = ' + ahlNameList);
+ List<Agency_Hospital_Link__c> ahlList = [select id,name,Hospital__c,MaxActivityDate__c from Agency_Hospital_Link__c where name = :ahlNameList and Agency_Campaign_Obj__c = true];
+
+ System.debug('ahlList.size() = ' + ahlList.size());
+ for(Agency_Hospital_Link__c ahl : ahlList){
+ ahlOcsmIdList.add(ahl.Hospital__c);
+ }
+ List<Agency_Contact__c> doctor2list = new List<Agency_Contact__c>();
+ System.debug('ahlOcsmIdList = ' + ahlOcsmIdList);
+ if(!Test.isRunningTest())
+ doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c,AWS_Data_Id__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name]; //zhj 鏂版柟妗堟敼閫� 2022-12-21 鍘绘帀Name_Encrypted__c
+
+ if(errorMag != ''){
+ return errorMag;
+ }
+ String doctor2listStr = JSON.serialize(doctor2list);
+ System.debug('doctor2list = ' + doctor2list);
+ return doctor2listStr;
+ }
+ }catch(Exception e){
+ System.debug('exception'+e);
+ return e.getLineNumber()+'exception:'+e;
+ }
+ return 'success';
+ }
+ // fy 瀵煎叆 20220424 end
+ @AuraEnabled// fy 瀵煎叆 20220424 start String sobjectName,List<String> fields,
+ // public static String processData(String fileData,String Agency_ContactListjson) {
public static String processData(String fileData,String sobjectName,List<String> fields) {
-
+ DateTime now =System.now();
+ System.debug('褰撳墠鏃堕棿:::'+now);
System.debug('fileData:::'+filedata);
System.debug('sobjectName:::'+sobjectName);
System.debug('fields:::'+fields);
+ // System.debug('Agency_ContactListjson::::'+Agency_ContactListjson);
String errorMag = '';
-
+
// 鍒涘缓鍛ㄦ姤
try{
-
+
if(fileData!=null){
+ // List<GeDatass> Agency_ContactList = (List<GeDatass>)JSON.deserialize(Agency_ContactListjson,List<GeDatass>.class);
+ // System.debug('Agency_ContactList::::'+Agency_ContactList);
+ // Map<String,String> Agency_ContactMap = new Map<String,String>();
+ // for(GeDatass agconobj :Agency_ContactList){
+ // Agency_ContactMap.put(agconobj.name.replace(' ',''),agconobj.dataId);
+ // }
String[] fileLines = new String[]{};
fileLines = fileData.split('\n');
// 鎷呭綋鍚嶇О鐨刲ist
@@ -542,6 +730,7 @@
system.debug('for2022161329');
List<String> inputvalues = new List<String>();
inputvalues = fileLines[i].split(',');
+ System.debug('inputvalues++'+inputvalues);
if(inputvalues != null){
system.debug('if2022161333');
if(inputvalues[0] == '' || inputvalues[0] == null){
@@ -554,23 +743,23 @@
errorMag += 'error1 绗�'+i+'琛屾暟鎹椿鍔ㄦ棩涓嶈兘涓虹┖';
errorMag += '=';
}
- //SWAG-C7AASP 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤琛ュ綍鏃堕棿璋冩暣 2022-1-10 pk start
- List<String> R = new List<String>();
- R = inputvalues[1].split('/');
- system.debug('R202216'+R);
- Date rDate = Date.newInstance(Integer.Valueof(R[0]),Integer.Valueof(R[1]),Integer.Valueof(R[2]));
- system.debug('rDate202216'+rDate);
- Date start = Date.today().addMonths(-1);
- Date startDay = start.toStartOfWeek();
- Date firstDayOfweek = System.today().toStartOfWeek();
- Date endDay = firstDayOfweek.addDays(6);
- if(rDate > endDay || rDate < startDay){
- system.debug('rDate >= ssDate');
- // return 'error1 绗�'+i+'琛屾暟鎹椿鍔ㄦ棩涓嶈兘涓虹┖';
- errorMag += 'error1 绗�'+i+'琛屾暟鎹�,瀵煎叆鍛ㄦ姤浠呭彲琛ユ姤鏈�杩戜竴鏈堝懆鎶�';
- errorMag += '=';
- }
- //SWAG-C7AASP 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤琛ュ綍鏃堕棿璋冩暣 2022-1-10 pk end
+ //SWAG-C7AASP 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤琛ュ綍鏃堕棿璋冩暣 2022-1-10 pk start
+ List<String> R = new List<String>();
+ R = inputvalues[1].split('/');
+ system.debug('R202216'+R);
+ Date rDate = Date.newInstance(Integer.Valueof(R[0]),Integer.Valueof(R[1]),Integer.Valueof(R[2]));
+ system.debug('rDate202216'+rDate);
+ Date start = Date.today().addMonths(-1);
+ Date startDay = start.toStartOfWeek();
+ Date firstDayOfweek = System.today().toStartOfWeek();
+ Date endDay = firstDayOfweek.addDays(6);
+ if(rDate > endDay || rDate < startDay){
+ system.debug('rDate >= ssDate');
+ // return 'error1 绗�'+i+'琛屾暟鎹椿鍔ㄦ棩涓嶈兘涓虹┖';
+ errorMag += 'error1 绗�'+i+'琛屾暟鎹�,瀵煎叆鍛ㄦ姤浠呭彲琛ユ姤鏈�杩戜竴鏈堝懆鎶�';
+ errorMag += '=';
+ }
+ //SWAG-C7AASP 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤琛ュ綍鏃堕棿璋冩暣 2022-1-10 pk end
if(inputvalues[2] == '' || inputvalues[2] == null){
// return 'error1 绗�'+i+'琛屾暟鎹尰闄笉鑳戒负绌�';
errorMag += 'error1 绗�'+i+'琛屾暟鎹尰闄笉鑳戒负绌�';
@@ -603,7 +792,7 @@
errorMag += '=';
}
if((inputvalues[7] != '' && inputvalues[7] != null)&& inputvalues[5] == inputvalues[7]){
-
+
// return 'error1 绗�'+i+'琛屾暟鎹骇鍝佸尯鍒�1鍜屼骇鍝佸尯鍒�3鐨勫�间笉鑳介噸澶�';
errorMag += 'error1 绗�'+i+'琛屾暟鎹骇鍝佸尯鍒�1鍜屼骇鍝佸尯鍒�3鐨勫�间笉鑳介噸澶�';
@@ -637,12 +826,13 @@
errorMag += '=';
}
}
- if(inputvalues[9] != '\r' && getResultlist(inputvalues[9])){
+ // if(inputvalues[9] != '\r' && getResultlist(inputvalues[9])){
+ if(inputvalues[9] != '' && getResultlist(inputvalues[9])){
// return 'error3 绗�'+i+'琛屾暟鎹粨鏋滈�夐」鍒楄〃鐨勫��'+inputvalues[9]+'涓嶅瓨鍦�';
errorMag += 'error3 绗�'+i+'琛屾暟鎹粨鏋滈�夐」鍒楄〃鐨勫��'+inputvalues[9]+'涓嶅瓨鍦�';
errorMag += '=';
}
- system.debug('inputvalues[0]=================>'+inputvalues[0]);
+ system.debug('inputvalues[0]=================>'+inputvalues[0]);
system.debug('inputvalues[1]=================>'+inputvalues[1]);
system.debug('inputvalues[2]=================>'+inputvalues[2]);
system.debug('inputvalues[3]=================>'+inputvalues[3]);
@@ -652,7 +842,8 @@
system.debug('inputvalues[7]=================>'+inputvalues[7]);
system.debug('inputvalues[8]=================>'+inputvalues[8]);
system.debug('inputvalues[9]=================>'+inputvalues[9]);
-
+ // system.debug('inputvalues[10]=================>'+inputvalues[10]);
+
nameList.add(inputvalues[0]);
dateList.add(Date.valueOf(inputvalues[1].replace('/','-')));
@@ -725,10 +916,19 @@
// for(ProductTypes__c protype : proTypeList){
// protypeMap.put(protype.Name, protype.Id);
// }
- List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name];
- for(Agency_Contact__c ac : doctor2list){
- doctor2Map.put(ac.Name.replace(' ',''), ac.Id);
+ //fy 20220424 start AWS_Data_Id__c
+ if(!Test.isRunningTest()){
+ List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c,AWS_Data_Id__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name]; //zhj 鏂版柟妗堟敼閫� 2022-12-21 鍘绘帀Name_Encrypted__c
+ for(Agency_Contact__c ac : doctor2list){
+ //fy 20220424 start
+ // doctor2Map.put(ac.AWS_Data_Id__c, ac.Id);
+ // doctor2Map.put(ac.Name.replace(' ',''), ac.Id);
+ //doctor2Map.put(ac.Name_Encrypted__c, ac.Id);
+ doctor2Map.put(ac.AWS_Data_Id__c, ac.Id); //zhj 鏂版柟妗堟敼閫� 涓嶅啀瀛樼殑nameEncrpt鑰屾槸awsdataid 2022-12-21
+ //fy 20220424 end
+ }
}
+
// List<Agency_Opportunity__c> aoList = [select id,name,StageName__c,Amount__c,OCMSale_Price__c,Close_Forecasted_Date__c,Agency_Hospital__c from Agency_Opportunity__c where Agency_Hospital__c = :ahlIdList and name = :ahlOppNameList];
@@ -840,9 +1040,15 @@
// errorMag += 'error2 绗�'+hang+'琛屾暟鎹瀹�'+lineList[3]+'涓嶅瓨鍦�';
// errorMag += '=';
}
-
- if(doctor2Map.containsKey(lineList[4].replace(' ',''))){
- agencyReport.doctor2__c = doctor2Map.get(lineList[4].replace(' ','')); // 鎷滆浜�
+ //fy 20220424 start
+ // if(doctor2Map.containsKey(lineList[4].replace(' ',''))){
+ if(doctor2Map.containsKey(lineList[4])){
+ // if(Agency_ContactMap.containsKey(lineList[4].replace(' ',''))){
+ // if(doctor2Map.containsKey(Agency_ContactMap.get(lineList[4].replace(' ','')))){
+ // agencyReport.doctor2__c = doctor2Map.get(lineList[4].replace(' ','')); // 鎷滆浜�
+ agencyReport.doctor2__c = doctor2Map.get(lineList[4]); // 鎷滆浜�
+ // agencyReport.doctor2__c = doctor2Map.get(Agency_ContactMap.get(lineList[4].replace(' ',''))); // 鎷滆浜�
+ // }
}else{
if(lineList[4] != '' && lineList[4] != null){
// return 'error2 绗�'+hang+'琛屾暟鎹嫓璁夸汉'+lineList[4]+'涓嶅瓨鍦�';
@@ -906,6 +1112,11 @@
// agencyReport.Product_Category3__c = protypeMap.get(lineList[7]);// 浜у搧鍖哄垎3
// }
agencyReport.Result__c = lineList[9];
+ if(lineList.size()==11){
+ if(lineList[10] != null && lineList[10] != ''){
+ agencyReport.SupportNeeds__c = lineList[10];
+ }
+ }
String headerStr = createHeader(week,s_agency);
if(agency_report_headerMap.containsKey(headerStr)){
agencyReport.Agency_Report_Header__c = agency_report_headerMap.get(headerStr).Id; // 鍛ㄦ姤涓�瑙�
@@ -945,7 +1156,7 @@
return 'success';
}catch(Exception e){
System.debug('exception'+e);
- return 'exception'+e;
+ return e.getLineNumber()+'exception:'+e;
}
return 'success';
}
@@ -1457,4 +1668,28 @@
}
// 鎵归噺娣诲姞鍛ㄦ姤by vivek end
+
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ @AuraEnabled
+ public static ControllerResponse searchAgencyDataId(String hospitalId){
+ ControllerResponse r = new ControllerResponse();
+ try{
+ if(String.isBlank(hospitalId)){
+ r.IsSuccess = true;
+ r.Message = 'noHospitalId';
+ return r;
+ }
+ List<Agency_Contact__c> acList = [select id,AWS_Data_Id__c,Agency_Hospital__r.Name from Agency_Contact__c where Agency_Hospital__c=:hospitalId];
+ r.IsSuccess = true;
+ r.Message = '';
+ r.Data = acList;
+ return r;
+ }catch(Exception e) {
+ System.debug('into catch'+e.getMessage());
+ r.IsSuccess = false;
+ r.message = e.getMessage()+e.getStackTraceString();
+ return r;
+ }
+ }
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
}
\ No newline at end of file
--
Gitblit v1.9.1