From b823c7f3569cf9368e2245846e918f78f32e903a Mon Sep 17 00:00:00 2001
From: GWY <guweiyiscp096@foxmail.com>
Date: 星期五, 15 四月 2022 11:38:47 +0800
Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlympusSSBG

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

diff --git a/force-app/main/default/classes/NewAndEditOrderController.cls b/force-app/main/default/classes/NewAndEditOrderController.cls
index 24a55f6..7eb816a 100644
--- a/force-app/main/default/classes/NewAndEditOrderController.cls
+++ b/force-app/main/default/classes/NewAndEditOrderController.cls
@@ -10,6 +10,10 @@
     public String PIPL_Input_Account_Error_Msg{set;get;}
     public String contactId{set;get;}//For Lookup field
     public String staticResourceContact {get; set;}
+    public String contactAWSDataId{set;get;}
+    public String contactName{set;get;}
+    public String endUserDAWSDataId{set;get;}
+    public String endUserDName{set;get;}
     public NewAndEditOrderController(ApexPages.StandardController controller){
         
     
@@ -33,9 +37,39 @@
         if(obj.Id == null){
             //鍒濆鍖栧姞杞藉��
             obj.put('OwnerId',UserInfo.getUserId());
+        } else {
+             //鑱旂郴浜虹殑Id
+            Order order = [select EndUser__c, EndUserD__c from Order where id=:obj.Id];
+            System.debug('order: ' + order);
+            if(order != null){
+                if (order.EndUser__c != null) {
+                    List<Contact> contact = [select AWS_Data_Id__c,Name from Contact where id=:order.EndUser__c];
+                    if(contact.size()>0){
+                        if (contact[0].AWS_Data_Id__c != null && contact[0].AWS_Data_Id__c != '') {
+                            contactAWSDataId = contact[0].AWS_Data_Id__c;
+                        }else {
+                            contactName = contact[0].Name;
+                        }
+                    }
+                }
+                if (order.EndUserD__c != null) {
+                    List<Contact> contact = [select AWS_Data_Id__c,Name from Contact where id=:order.EndUserD__c];
+                    if(contact.size()>0){
+                        if (contact[0].AWS_Data_Id__c != null && contact[0].AWS_Data_Id__c != '') {
+                            endUserDAWSDataId = contact[0].AWS_Data_Id__c;
+                        }else {
+                            endUserDName = contact[0].Name;
+                        }
+                    }
+                }
+            }else {
+                contactAWSDataId = '鏃�';
+                contactName = '鏃�';
+            }
         }
         //contact淇℃伅锛堟悳绱㈡煡璇uery url鐢級
         staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
+
     }
 
     

--
Gitblit v1.9.1