From 01f207d979d6be17c8cdec293feab48828c0ec3e Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期五, 08 四月 2022 14:22:52 +0800
Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG

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

diff --git a/force-app/main/default/classes/StraightBackAddressController.cls b/force-app/main/default/classes/StraightBackAddressController.cls
index 4b8b354..6a358f5 100644
--- a/force-app/main/default/classes/StraightBackAddressController.cls
+++ b/force-app/main/default/classes/StraightBackAddressController.cls
@@ -12,6 +12,7 @@
     public String tableDataStr{ get; set; }
     public String staticResource {get; set;}
     public String staticResourceContact {get; set;}
+    public String staticResourceRepair {get; set;}
     public Contact newCon{get; set;}
 
     /***************搴曢儴 缂栬緫鍜屾柊澧炵殑 瀵硅薄*******************/
@@ -101,13 +102,18 @@
 
         staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Address__c'));
         staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
+        staticResourceRepair = JSON.serialize(PIHelper.getPIIntegrationInfo('Repair__c'));
     }
 
     /**
      * 寮�濮嬫柟娉�
      */
     public PageReference init(){
-        accOfficeTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Office').getRecordTypeId();
+        Schema.RecordTypeInfo recordTypeValue = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Office');
+        if(recordTypeValue == null){
+            recordTypeValue = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('office');
+        }
+        accOfficeTypeId = recordTypeValue.getRecordTypeId();
         accAgencyTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
         accAgencyContactTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('AgencyContact').getRecordTypeId();
         String RepairSql = makeTextRepairSql(RepairId);
@@ -582,7 +588,7 @@
 
     //鏌ヨ淇悊琛ㄦ暟鎹�
     private String makeTextRepairSql(String uuid){
-        String RepairSql = 'SELECT ID,NAME,HP_ID__c,HP_Name__c,Delivered_Product__c,FSE_ApplyForRepair_time__c,SAP_Transfer_time__c,Dealer__c,Dealer__r.Name,Returns_Product_way__c,Address_Type_Index__c FROM Repair__c where id = \''+RepairId+'\'';
+        String RepairSql = 'SELECT ID,NAME,HP_ID__c,HP_Name__c,Delivered_Product__c,FSE_ApplyForRepair_time__c,SAP_Transfer_time__c,Dealer__c,Dealer__r.Name,Returns_Product_way__c,Address_Type_Index__c,AWS_Data_Id__c FROM Repair__c where id = \''+RepairId+'\'';
         return RepairSql;
     }
     //鏌ヨ鍦板潃琛ㄦ暟鎹�
@@ -678,6 +684,14 @@
     class AddressData {
         //鏁版嵁
         public Address__c address { get; set; }
+
+        public string addressJson { get{
+            if (address == null) {
+                return null;
+            }
+            return JSON.serialize(address);
+        } }
+
         //缂栬緫鎸夐挳鏄惁灞曠ず
         public String canEdit { get; private set; }
         //缂栬緫鎸夐挳鏄惁灞曠ず

--
Gitblit v1.9.1