From cb676d5d9631864b9fd634f9b3052a17c41ed345 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 26 六月 2023 09:04:26 +0800
Subject: [PATCH] 修改按钮

---
 force-app/main/default/classes/ReportController.cls |   83 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 75 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/classes/ReportController.cls b/force-app/main/default/classes/ReportController.cls
index 9afd242..76a56d9 100644
--- a/force-app/main/default/classes/ReportController.cls
+++ b/force-app/main/default/classes/ReportController.cls
@@ -2,6 +2,44 @@
 鐢ㄤ簬缁檒wc鐨刯s鍒濆鍖栨暟鎹拰瀵硅褰曡繘琛宒ml鎿嶄綔锛屾controller灞炰簬鎶ュ憡涔�
 */
 public with sharing class ReportController {
+
+    @AuraEnabled
+    public static InitData initForOPDReportConsumButton(String recordId){
+        InitData res = new initData();
+        try {
+            Consum_Apply__c con = [select RA_Status__c,Product_category__c,Id,Hospital__c,Strategic_dept__c,Account__c from Consum_Apply__c where Id =: recordId];
+            res.raStatus = con.RA_Status__c;
+            res.productCategory = con.Product_category__c;
+            res.consumApplyId = con.Id;
+            res.hospital = con.Hospital__c;
+            res.strategicDept = con.Strategic_dept__c;
+            res.account = con.Account__c;
+            res.recordTypeId1 = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SIS_ENG).getRecordTypeId();
+            res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SIS_ET).getRecordTypeId();
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initForOPDReportButton(String recordId){
+        InitData res = new initData();
+        try {
+            Rental_Apply__c rent = [select RA_Status__c,Asset_return_day2__c,Hospital__c,Strategic_dept__c,Account__c,OPDPlan__c,Follow_UP_Opp__c,demo_purpose2__c from Rental_Apply__c where Id =: recordId];
+            res.raStatus = rent.RA_Status__c;
+            res.assetReturnDay2 = rent.Asset_return_day2__c;
+            res.hospitalId = rent.Hospital__c;
+            res.strategicDeptId = rent.Strategic_dept__c;
+            res.accountId = rent.Account__c;
+            res.demoPurpose2 = rent.demo_purpose2__c;
+            res.followUPOpp = rent.Follow_UP_Opp__c;
+            res.opdPlan = rent.OPDPlan__c;
+            res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return res;
+    }
     //缁橵OC瀹屾瘯鐩稿簲鐨刯s鎻愪緵鍒濆鍖栨暟鎹�
     @AuraEnabled
     public static InitData initForVOCFinishButton (String recordId) {
@@ -248,7 +286,7 @@
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
-            rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
+            rac.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
             update rac;
             return null;
         } catch (Exception e) {
@@ -284,7 +322,7 @@
         try {
             rac.Id = recordId;
             rac.Status__c = LightingButtonConstant.STATUS_COMPLETE;
-            rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.VOC_NAME).getRecordTypeId();
+            rac.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.VOC_NAME).getRecordTypeId();
             update rac;
             return null;
         } catch (Exception e) {
@@ -317,7 +355,7 @@
         Report__c rac = new Report__c();
         try {
             rac.Id = recordId;
-            rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE).getRecordTypeId();
+            rac.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE).getRecordTypeId();
             update rac;
             return null;
         } catch (Exception e) {
@@ -413,6 +451,8 @@
             return eMessage.substring(left,right);
         }
     }
+
+   
     //VOC鍥炵瓟鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
     public static String updateForVOCAnswerButton(String recordId){
@@ -610,10 +650,37 @@
         public String huDiAnId;
         @AuraEnabled
         public String systemProfileId;
-        
-
-
-
-
+        @AuraEnabled
+        public String raStatus;
+        @AuraEnabled
+        public String productCategory;
+        @AuraEnabled
+        public String hospitalId;
+        @AuraEnabled
+        public String hospital;
+        @AuraEnabled
+        public String strategicDeptId;
+        @AuraEnabled
+        public String strategicDept;
+        @AuraEnabled
+        public String accountId;
+        @AuraEnabled
+        public String account;
+        @AuraEnabled
+        public String rentalApplyId;
+        @AuraEnabled
+        public String consumApplyId;
+        @AuraEnabled
+        public String recordTypeId;
+        @AuraEnabled
+        public String recordTypeId1;
+        @AuraEnabled
+        public Date assetReturnDay2;
+        @AuraEnabled
+        public String followUPOpp;
+        @AuraEnabled
+        public String demoPurpose2;
+        @AuraEnabled
+        public String opdPlan;
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1