黄千龙
2023-03-08 962519811b7c4be07f30d09e791798b0ea79d3ae
force-app/main/default/classes/RetrospectiveWeeklyReportController.cls
@@ -922,6 +922,7 @@
                List<Agency_Hospital_Link__c> ahlList;
                Contact conStrList = [select AccountId from contact where  id in (select ContactId from User where id =: SignInId)];
                String strAgencyId =conStrList.AccountId;
                System.debug('UserProTypec.UserPro_Type__c = ' + UserProTypec.UserPro_Type__c);
                if(UserProTypec.UserPro_Type__c == 'ENG'){
                    ahlList =  [select id,name,Hospital__c,MaxActivityDate__c from Agency_Hospital_Link__c where Agency__c =: strAgencyId and name = :ahlNameList and AgencyHos_ENG__c = true and Agency_Campaign_Obj__c = true];
                }else {
@@ -963,6 +964,7 @@
                //     nameConMap.put(con.Id, con.Name);
                // }
                // return testuse;
                System.debug('ahlList = ' + ahlList);
                for(Agency_Hospital_Link__c ahl : ahlList){
                    ahlMap.put(ahl.Name, ahl);
                    ahlOcsmIdList.add(ahl.Hospital__c);
@@ -1075,6 +1077,8 @@
                    if(lineList[0] != null && lineList[0] != ''){
                        agencyReport.Report_Date__c = Date.valueOf(lineList[0].replace('/','-')); 
                    }
                    System.debug('ahlMap = ' + ahlMap);
                    System.debug('lineList[1] = ' + lineList[1]);
                    if(ahlMap.containsKey(lineList[1])){
                        agencyReport.Agency_Hospital__c = ahlMap.get(lineList[1]).Id;    
                        ahlMap.get(lineList[1]).MaxActivityDate__c = week;