From f127c76b19f5316032d4bed127a1dde710c48d74 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期四, 24 三月 2022 10:10:36 +0800
Subject: [PATCH] PIPLFunctionFixBug0324

---
 force-app/main/default/classes/NewAndEditReportController.cls |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/classes/NewAndEditReportController.cls b/force-app/main/default/classes/NewAndEditReportController.cls
index 638443e..90e5e6c 100644
--- a/force-app/main/default/classes/NewAndEditReportController.cls
+++ b/force-app/main/default/classes/NewAndEditReportController.cls
@@ -19,6 +19,8 @@
     public String sobjecttypeForFrontEnd{set;get;}
     public String sobjectId{set;get;}
     public String layoutSectionsStr {get; set;}
+    public String no1Name{get; set;}
+    public String no1Id{get; set;}
     public NewAndEditReportController(ApexPages.StandardController controller) {
         sobjectId = [SELECT CustomObjectId,CustomObjectName  FROM CustomObjectUserLicenseMetrics   where CustomObjectName ='Report' limit 1].CustomObjectId;
         isNewMode = true;
@@ -62,6 +64,21 @@
                 sfIdToAWSIdMap.put(String.valueof(ReportData.Person_In_Charge__r.Id).subString(0,15),ReportData.Person_In_Charge__r.AWS_Data_Id__c);
             }
             contactsInfo = JSON.serialize(sfIdToAWSIdMap);
+        }else if(ApexPages.currentPage().getParameters().get('CF00N10000008ps6d_lkid') != null){
+            //OPD璁″垝杩囨潵鐨勶紝閫氳繃Id鏌ュ嚭鍊熷嚭澶囧搧鐢宠No1杩涜灞曠ず
+            String opdPlanId = ApexPages.currentPage().getParameters().get('CF00N10000008ps6d_lkid');
+            if(String.isNotEmpty(opdPlanId)&&String.isNotBlank(opdPlanId)){
+                List<OPDPlan__c> opList = [select NewestRentalCode__c from OPDPlan__c where id=:opdPlanId];
+                if(opList!=null&&opList.size()>0){
+                    no1Name = opList[0].NewestRentalCode__c;
+                    List<Rental_Apply__c> racList = [select id from Rental_Apply__c where Name=:opList[0].NewestRentalCode__c];
+                    if(racList!=null&&racList.size()>0){
+                        no1Id = racList[0].id;
+                    }                   
+                }
+            }                                  
+            rtTypeId = ApexPages.currentPage().getParameters().get('RecordType');
+            obj.put('OwnerId',UserInfo.getUserId());
         }else{
             //鏂板缓
             rtTypeId = ApexPages.currentPage().getParameters().get('RecordType');
@@ -76,6 +93,7 @@
         PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Report__c');
         staticResource = JSON.serialize(piIntegration);
         encryptedAPIList = piIntegration.PIFields;
+        System.debug('piIntegration.PIFields = ' + encryptedAPIList);
         staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
         sobjectPrefix = piIntegration.sobjectPrefix;
         layoutSectionsStr = JSON.serialize(layoutSections);

--
Gitblit v1.9.1