From f0adfc7326311c6ba40281ffe48437d41a79bd32 Mon Sep 17 00:00:00 2001
From: twysparks <twysparks@163.com>
Date: 星期三, 24 五月 2023 17:32:43 +0800
Subject: [PATCH] 服务

---
 force-app/main/default/classes/buttonOnCallCtl.cls |   68 +++++++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/classes/buttonOnCallCtl.cls b/force-app/main/default/classes/buttonOnCallCtl.cls
index 2622b4f..8eb8bd1 100644
--- a/force-app/main/default/classes/buttonOnCallCtl.cls
+++ b/force-app/main/default/classes/buttonOnCallCtl.cls
@@ -7,9 +7,21 @@
     public static InitData init(String recordId){
         InitData res = new initData();
         try{
-            On_Call__c report =  [SELECT Id FROM On_Call__c WHERE Id =: recordId LIMIT 1];
+            On_Call__c report =  [SELECT Id,Name,Oncall_Equipment__r.Id,segment__r.Id,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 WHERE Id =: recordId LIMIT 1];
             System.debug(LoggingLevel.INFO, '*** opp: ' + report);
             res.Id = report.Id;
+            res.Name = report.Name;
+            res.SegmentC = report.segment__c;
+            res.SegmentId = report.segment__r.Id;
+            res.HPC = report.HP__c;
+            res.HospitalIdC = report.HospitalId__c;
+            res.SalesdepartmentHPIDC = report.Salesdepartment_HP_ID__c;
+            res.SalesdepartmentHPC = report.Salesdepartment_HP__c;
+            res.OncallEquipmentC = report.Oncall_Equipment__c;
+            res.OncallEquipmentId = report.Oncall_Equipment__r.Id;
+            res.TrableOccurdaYCollectC = report.Trable_occur_daY_collect_c__c;
+
+            res.userID = UserInfo.getUserId();
 
             System.debug(LoggingLevel.INFO, '*** res: ' + res);
         }catch(Exception e){
@@ -18,8 +30,62 @@
         return res;
     }   
 
+    @AuraEnabled
+    public static List<Account> selecctAccountBySegmentId(String segmentId){
+        try {
+          List<Account> accounts = [SELECT ParentId,Parent.RecordTypeId,Parent.RecordType_DeveloperName__c ,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 FROM Account WHERE Id=: segmentId];
+          return accounts;
+      } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+         }
+     }
+
+     @AuraEnabled
+     public static List<Account> selecctAccountBySegmentId02(String segmentId){
+         try {
+           List<Account> accounts = [SELECT id,ParentId,Parent.RecordTypeId,Parent.RecordType_DeveloperName__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=: segmentId];
+           return accounts;
+       } catch (Exception e) {
+             throw new AuraHandledException(e.getMessage());
+          }
+      }
+
+       // 鏌ユ壘UserName
+    @AuraEnabled
+    public static List<User> initUserName(String userId){
+        List<User> res = new List<User>();
+        try{
+            res = [SELECT Id,name,RepairSalesPoint_Province_China__c,Employee_No__c FROM User WHERE Id=: userId ];
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
     public class InitData{
         @AuraEnabled
         public String Id;
+        @AuraEnabled
+        public String Name;
+        @AuraEnabled
+        public String SegmentC;
+        @AuraEnabled
+        public String HPC;
+        @AuraEnabled
+        public String HospitalIdC;
+        @AuraEnabled
+        public String SalesdepartmentHPIDC;
+        @AuraEnabled
+        public String SalesdepartmentHPC;
+        @AuraEnabled
+        public String OncallEquipmentC;
+        @AuraEnabled
+        public Date TrableOccurdaYCollectC;
+        @AuraEnabled
+        public String userID;
+        @AuraEnabled
+        public String SegmentId;
+        @AuraEnabled
+        public String OncallEquipmentId;
      }
 }
\ No newline at end of file

--
Gitblit v1.9.1