| | |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.userEmail = UserInfo.getUserEmail(); |
| | | |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | |
| | | //通过Is_Validity__c和Id字段查询Account的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Account> queryForFindInvalidLicense(Boolean isValidity,String dealerId){ |
| | | public static List<Account> queryForFindInvalidLicense(String dealerId){ |
| | | try { |
| | | List<Account> accounts = [select Id,Is_Validity__c from Account where Is_Validity__c = false And Id = :dealerId]; |
| | | return accounts; |
| | |
| | | |
| | | //通过Id查询Repair__c中的Dealer__c,再根据Dealer__c查询Account中的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Account> queryForrecords3(String recordId){ |
| | | public static List<Account> queryForrecords3(String dealer){ |
| | | try { |
| | | Repair__c repair = [select Repair__c.Dealer__c from Repair__c where Id =:recordId]; |
| | | List<Account> accounts = [select id, FirstParagraph__c from Account where name =:repair.Dealer__c]; |
| | | List<Account> accounts = [SELECT id, FirstParagraph__c from Account where name =:dealer]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | |
| | | //更新Repair__c中的记录,将Maintenance_Contract__c和MaintenanceContractType__c字段更新为空,若捕获到异常则返回错误信息 |
| | | @AuraEnabled |
| | | public static String updateForRepair1(String recordId){ |
| | | String res=''; |
| | | try { |
| | | Repair__c repair = new Repair__c(); |
| | | repair.ID = recordId; |
| | | repair.Id = recordId; |
| | | repair.Maintenance_Contract__c = null; |
| | | repair.MaintenanceContractType__c = null; |
| | | update repair; |
| | | return null; |
| | | } catch (Exception e) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(',') + 1; |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | res = e.getMessage(); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | //更新Repair__c中的记录,若捕获到异常则返回错误信息 |
| | | @AuraEnabled |
| | | public static String updateRepair2(String recordId,User staff,Boolean DWSign,String statusc,String DOJStatus,String SAPcondition){ |
| | | String res=''; |
| | | try { |
| | | Repair__c repair = new Repair__c(); |
| | | repair.Id = recordId; |
| | |
| | | repair.SAP_Transfer_time__c = Datetime.now(); |
| | | } |
| | | update repair; |
| | | return null; |
| | | } catch (Exception e) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(',') + 1; |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | res = e.getMessage(); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | //查询Account的记录 |
| | | // 查找简档 |
| | | @AuraEnabled |
| | | public static List<Account> selecctAccount(){ |
| | | public static List<Profile> initSelectProfile(String profileId){ |
| | | List<Profile> res = new List<Profile>(); |
| | | try { |
| | | List<Account> accounts = [SELECT Hospital_ID__c,Department_Class_ID_18__c,Id,Hospital__c,Department_Class__c,Name FROM Account]; |
| | | return accounts; |
| | | res = [SELECT Id,name FROM Profile WHERE Id=: profileId ]; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | //查询Account修理画面“修理品返送地”问题调查-后续 |
| | | // 查找UserName |
| | | @AuraEnabled |
| | | public static List<Account> selecctAccountById(String id){ |
| | | public static List<User> initUserName(String userId){ |
| | | List<User> res = new List<User>(); |
| | | try { |
| | | List<Account> accounts = [SELECT ParentId,Parent.RecordTypeId ,Parent.Parent.FSE_GI_Main_Leader__c, Parent.Parent.FSE_GI_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__c,Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE ID=:id]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //查询Account修理画面“修理品返送地”问题调查-后续 |
| | | @AuraEnabled |
| | | public static List<Account> selecctAccountBySegmentId(String segmentId){ |
| | | try { |
| | | List<Account> accounts = [SELECT id,ParentId,Parent.RecordTypeId, Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE Id=:segmentId]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //查询Product2 |
| | | @AuraEnabled |
| | | public static List<Product2> selecctProduct2ById(String Id){ |
| | | try { |
| | | List<Product2> accounts = [SELECT id,Name,Can_Repair__c from Product2 where ID=:Id]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //查询QIS_Report__c |
| | | @AuraEnabled |
| | | public static List<QIS_Report__c> selecctQISReportByFomatToday(String AssetId,Date fomatToday){ |
| | | try { |
| | | List<QIS_Report__c> accounts = [SELECT id,Name,QIS_Submit_day__c from QIS_Report__c where nonyushohin__c=:AssetId and QIS_Submit_day__c != null and QIS_Submit_day__c >=:fomatToday]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //查询Repair__c |
| | | @AuraEnabled |
| | | public static List<Repair__c> selecctRepairByFomatToday(String AssetId, Date fomatToday){ |
| | | try { |
| | | List<Repair__c> accounts = [SELECT Name from Repair__c where Delivered_Product__c =:AssetId and Status2__c!='00.删除' and Status2__c!='00.取消' and FSE_ApplyForRepair_Day__c >=: fomatToday order by FSE_ApplyForRepair_Day__c desc limit 1]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //查询lexCreateRepairFromDepartment User |
| | | @AuraEnabled |
| | | public static List<User> selecctUser(){ |
| | | try { |
| | | List<User> user = [SELECT Id,RepairSalesPoint_Province_China__c,Employee_No__c FROM User]; |
| | | return user; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //查询lexCreateRepairFromDepartment QIS_Report__c |
| | | @AuraEnabled |
| | | public static List<QIS_Report__c> selecctQISReport(){ |
| | | try { |
| | | List<QIS_Report__c> user = [SELECT Hospital__c,Id,OCM_judgement__c,next_action__c,Special_follow__c,HP_ID__c,Source_OnCall__c,Name,Department_Class_Id__c,Department_Class__c,Hospital_Department__c,nonyushohin__c,Trable_occur_daY_collect__c,source_for_repair__c FROM QIS_Report__c]; |
| | | return user; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //查询OnCall的记录 |
| | | @AuraEnabled |
| | | public static List<On_Call__c> selecctOnCallC(){ |
| | | try { |
| | | List<On_Call__c> accounts = [SELECT Id,Name,segment__c,HP__c,HospitalId__c,Salesdepartment_HP_ID__c,Salesdepartment_HP__c,Oncall_Equipment__c,Trable_occur_daY_collect_c__c FROM On_Call__c]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | // 查找保有设备 |
| | | @AuraEnabled |
| | | public static List<Asset> selectAsset(){ |
| | | List<Asset> res = new List<Asset>(); |
| | | try{ |
| | | res = [SELECT Id,NoPartRiskDate_F__c,Product_ID__c,AccountId,HP_Id__c,Hospital__c,Department_Class__c,Name FROM Asset]; |
| | | res = [SELECT Id,name FROM User WHERE Id=: userId ]; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |