buli
2023-05-22 71b93327e8f3fb3bffffc7c033c1f782e7b6ab32
force-app/main/default/classes/otherButtonRepairController.cls
@@ -119,7 +119,6 @@
            res.profileId = UserInfo.getProfileId();
            res.userEmail = UserInfo.getUserEmail();
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -408,6 +407,117 @@
        }
    }
    //查询Account的记录
    @AuraEnabled
    public static List<Account> selecctAccount(){
        try {
          List<Account> accounts = [SELECT Hospital_ID__c,Department_Class_ID_18__c,Id,Hospital__c,Department_Class__c,Name FROM Account];
          return accounts;
      } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
         }
     }
     //查询Account修理画面“修理品返送地”问题调查-后续
    @AuraEnabled
    public static List<Account> selecctAccountById(String id){
        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];
         }catch(Exception e){
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
         }
         return res;
     }
    public class InitData{
        @AuraEnabled
        public String detailedAddress;