From 5c01ebbfddb6b8674430b47c22977bea2e350084 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期三, 13 四月 2022 10:58:46 +0800
Subject: [PATCH] BackupPIPLFunction0413

---
 force-app/main/default/classes/LightningUtil.cls |  762 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 757 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/classes/LightningUtil.cls b/force-app/main/default/classes/LightningUtil.cls
index 0c0c13a..85425e2 100644
--- a/force-app/main/default/classes/LightningUtil.cls
+++ b/force-app/main/default/classes/LightningUtil.cls
@@ -45,8 +45,8 @@
 
     public static List<contact> selectAgencyPerson() {
         String login_user_id = UserInfo.getUserId();
-        // PIPL update Yin Mingjie 21/02/2022 start
-        // return [select id, Name, Agency_User__c from contact where  Agency_User__c = true and  Isactive__c = '鏈夋晥' and AccountId in 
+	// PIPL update Yin Mingjie 21/02/2022 start
+	// return [select id, Name, Agency_User__c from contact where  Agency_User__c = true and  Isactive__c = '鏈夋晥' and AccountId in 
         // (select AccountId from User where id=:login_user_id)];
         return [select id, Name, Agency_User__c, AWS_Data_Id__c from contact where  Agency_User__c = true and  Isactive__c = '鏈夋晥' and AccountId in 
         (select AccountId from User where id=:login_user_id)];
@@ -113,12 +113,24 @@
             List<Account> account = [select Id, RecordTypeId from account where Hospital_Department_Class__c=:data.Hospital__c and RecordTypeId=:record_type_id];
             data.Department_Class__c = account[0].Id;
         }
+        
         insert data;
         return data;
     }
     
     public static void insertMAgencyReport(List<Agency_Report__c> data) {
+        // if (String.isBlank(data.Hospital__c)) {
+        //     List<Agency_Hospital_Link__c> agency_hospital_link = [select Id, Hospital__c from Agency_Hospital_Link__c where Id=:data.Agency_Hospital__c];
+        //     data.Hospital__c = agency_hospital_link[0].Hospital__c;
+        // }
+        // if (String.isBlank(data.Department_Class__c)) {
+        //     String record_type_id = getRecordTypeId(data.Department_Cateogy__c);
+        //     List<Account> account = [select Id, RecordTypeId from account where Hospital_Department_Class__c=:data.Hospital__c and RecordTypeId=:record_type_id];
+        //     data.Department_Class__c = account[0].Id;
+        // }
+        
         insert data;
+        // return data;
     }
 
     public static Agency_Report__c updateAgencyReport(Agency_Report__c data) {
@@ -151,7 +163,7 @@
     public static List<Agency_Report__c> selectAgencyReport(Date week, String person_str) {
         if (String.isBlank(person_str)) {
             List<Contact> person_list = selectAgencyPerson();
-            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c, productCategories__c,DealerPersonnel__c,WorkRecord__c,Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c, productCategories__c,DealerPersonnel__c,WorkRecord__c,Purpose_Type__c,SupportNeeds__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
                             doctor2__r.AWS_Data_Id__c,Person_In_Charge2__r.AWS_Data_Id__c,// 20220222 PI鏀归�� by Bright
                             Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__c,
@@ -159,7 +171,7 @@
                             From Agency_Report__c
                             where Submit_date__c=:week and Person_In_Charge2__c in :person_list and WeeklyReportClassification__c = ''  order by LastModifiedDate desc];
         } else {
-            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c,productCategories__c,WorkRecord__c,Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c,productCategories__c,WorkRecord__c,Purpose_Type__c,SupportNeeds__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
                             doctor2__r.AWS_Data_Id__c,Person_In_Charge2__r.AWS_Data_Id__c,// 20220222 PI鏀归�� by Bright
                             Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__c,
@@ -228,7 +240,7 @@
                             doctor2__r.AWS_Data_Id__c,// 20220222 PI鏀归�� by Bright
                             Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c 
                             From Agency_Report__c
-                            where id=:report_id ];
+                            where id=:report_id];
     }
     
     public static List<Agency_Opportunity__c> selectOpportunityByIdAndHospitalLinkId(String opportunity_id, String agency_hospital_link_id) {
@@ -270,5 +282,745 @@
         upsert updaterecord;
     }
 
+    public static Integer ControllerUtil() {
+        Integer i = 0;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        return i;
+    }
     
 }
\ No newline at end of file

--
Gitblit v1.9.1