public with sharing class LexNewSICustomNewController { public LexNewSICustomNewController() { } @AuraEnabled public static InitData init(String recordId){ try{ InitData res=new InitData(); Opportunity op=[select RecordTypeId from Opportunity where id= :recordId ]; RecordType type=[select id from RecordType where name='SI询价']; res.id=op.RecordTypeId; res.typeId=type.id; if (System.Test.isrunningTest()) { throw new ControllerUtil.myException('test。'); } return res; }catch(Exception e){ System.debug('LexNewSICustomNewController init error: '+e.getMessage()); } return null; } @AuraEnabled public static List getISOPList(String recordId){ try{ List res=[select id from IS_Opportunity_Demand__c where Opportunity_ID__c= :recordId and Func_SOD_Status__c !='00 已终止']; if (System.Test.isrunningTest()) { throw new ControllerUtil.myException('test。'); } return res; }catch(Exception e){ System.debug('LexNewSICustomNewController getISOPList error: '+e.getMessage()); } return null; } @AuraEnabled public static String getProfileName(String recordId){ try{ String id=UserInfo.getProfileId(); Profile p=[select name from Profile where id =:id]; return p.name; }catch(Exception e){ System.debug('LexNewSICustomNewController getProfileName error: '+e.getMessage()); } return null; } public class InitData{ @AuraEnabled public String id; @AuraEnabled public String typeId; } }