高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/AgencyOpportunityHandler.cls
@@ -239,6 +239,7 @@
        }
        // FIXME develoerNameより
        /*20230214 you  DB202302187947 101去掉一个sql
        String[] deptTypes = new String[] {'Department_Class_OTH', 'Department_Class_BF', 'Department_Class_GYN', 'Department_Class_GS', 'Department_Class_URO', 'Department_Class_GI', 'Department_Class_ENT', 'Department_Class_ET'};
        List<RecordType> deptRects = [select Id, DeveloperName from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN :deptTypes];
        Map<String, String> deptRectMap = new Map<String, String>();
@@ -262,6 +263,32 @@
                deptRectMap.put('ET', rect.Id);
            }
        }
        */
        //添加新逻辑 start
        String[] deptTypes = new String[] {'Department_Class_OTH', 'Department_Class_BF', 'Department_Class_GYN', 'Department_Class_GS', 'Department_Class_URO', 'Department_Class_GI', 'Department_Class_ENT', 'Department_Class_ET'};
        Map<String, String> deptRectMap = new Map<String, String>();
        Map<String, Schema.RecordTypeInfo> deptrectAllMap = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName();
        for (string rect : deptTypes) {
            ID accid=deptrectAllMap.get(rect).getRecordTypeId();
            if (rect == 'Department_Class_OTH') {
                deptRectMap.put('OTH', accid);
            } else if (rect == 'Department_Class_BF') {
                deptRectMap.put('BF', accid);
            } else if (rect == 'Department_Class_GYN') {
                deptRectMap.put('GYN', accid);
            } else if (rect == 'Department_Class_GS') {
                deptRectMap.put('GS', accid);
            } else if (rect == 'Department_Class_URO') {
                deptRectMap.put('URO', accid);
            } else if (rect == 'Department_Class_GI') {
                deptRectMap.put('GI', accid);
            } else if (rect == 'Department_Class_ENT') {
                deptRectMap.put('ENT', accid);
            } else if (rect == 'Department_Class_ET') {
                deptRectMap.put('ET', accid);
            }
        }
         //添加新逻辑 end
        Map<Id, Id> ahMap = new Map<Id, Id>();
        List<Agency_Hospital_Link__c> ahlist = [select Id, Hospital__c from Agency_Hospital_Link__c where Id in :ahId];