From 7f68ed6f7658db35544204ab5dcf6a3800e1b756 Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期二, 22 三月 2022 17:49:57 +0800
Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG

---
 force-app/main/default/classes/LightningUtil.cls               |    4 ++--
 force-app/main/default/classes/ConsumableOrderTriggerTest.cls  |    2 +-
 force-app/main/default/triggers/ConsumableOrderTrigger.trigger |    9 ++++++---
 force-app/main/default/classes/NFM624Rest.cls                  |    4 ++++
 4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/force-app/main/default/classes/ConsumableOrderTriggerTest.cls b/force-app/main/default/classes/ConsumableOrderTriggerTest.cls
index 3c7ef30..046b7aa 100644
--- a/force-app/main/default/classes/ConsumableOrderTriggerTest.cls
+++ b/force-app/main/default/classes/ConsumableOrderTriggerTest.cls
@@ -10,7 +10,7 @@
         if (rectCotac.size() == 0) {
             return;
         }
-        Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�'];
+        Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
         Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽');
         Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽');
         insert new Product2[]{prod01,prod02};
diff --git a/force-app/main/default/classes/LightningUtil.cls b/force-app/main/default/classes/LightningUtil.cls
index 9fd9a30..d2937e0 100644
--- a/force-app/main/default/classes/LightningUtil.cls
+++ b/force-app/main/default/classes/LightningUtil.cls
@@ -149,7 +149,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, 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, 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,
@@ -157,7 +157,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, 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, 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,
diff --git a/force-app/main/default/classes/NFM624Rest.cls b/force-app/main/default/classes/NFM624Rest.cls
index 9ccbc47..e1cb52f 100644
--- a/force-app/main/default/classes/NFM624Rest.cls
+++ b/force-app/main/default/classes/NFM624Rest.cls
@@ -228,6 +228,8 @@
                                                       AccountId 
                                                       from Contact 
                                                       where CManageCode__c IN: PersonManagementCodeList 
+                                                      OR Account.PlatformCode__c IN: ManagementList
+                                                      OR Account.Management_Code__c IN: SFDCCodeList
                                                       OR Account.Parent_PlatformCode__c IN: ManagementList 
                                                       OR Account.Parent_Management_Code__c IN: SFDCCodeList]; //鏍规嵁浜哄憳绠$悊缂栫爜妫�绱㈣仈绯讳汉
                 Map < String, Contact > peopleMap = new Map < String, Contact > (); //鑱旂郴浜�
@@ -509,6 +511,8 @@
                                         //鍥犱负娌℃湁鍖婚櫌绠$悊缂栫爜锛屾棤娉曟绱㈠埌鎴樼暐绉戝锛屾墍浠ュ湪缁欑瀹ょ殑鎴樼暐绉戝瀛楁璧嬪�兼椂绌烘寚閽�
                                         //dpt.Department_Class__c = DepartmentClassMap.get(gedata.DepartmentClass).Id;
                                         //dpt.ParentId = DepartmentClassMap.get(gedata.DepartmentClass).Id;
+                                        dpt.Department_Class__c = DepartmentClassMap.get(gedata.DepartmentClass).Id;
+                                        dpt.ParentId = DepartmentClassMap.get(gedata.DepartmentClass).Id;
                                         if (string.isnotblank(personCode)) { //浜哄憳绠$悊缂栫爜瀛樺湪
                                             if (peopleMap.containsKey(personCode)) { //浜哄憳绠$悊缂栫爜鏌ユ壘鏈夊�� 13 瀹屾垚
                                                 System.debug('13閫昏緫');
diff --git a/force-app/main/default/triggers/ConsumableOrderTrigger.trigger b/force-app/main/default/triggers/ConsumableOrderTrigger.trigger
index 11d6bfe..85f86c0 100644
--- a/force-app/main/default/triggers/ConsumableOrderTrigger.trigger
+++ b/force-app/main/default/triggers/ConsumableOrderTrigger.trigger
@@ -1,7 +1,10 @@
 trigger ConsumableOrderTrigger on Consumable_order__c (before insert, before update) {
-	if (StaticParameter.EscapeConsumableOrderDetail2Trigger) {
-		return;
-	}
+	// CHAN-CBYBBF 銆愬鎵樸�戠粡閿�鍟咵T璐﹀彿鏄剧ず鐣岄潰缁存姢-骞夸笢姹囨櫒 start
+	// 娉ㄩ噴璺宠繃 鍙戣揣鏃惰璁$畻 SAP鍚堝悓鍙�
+	// if (StaticParameter.EscapeConsumableOrderDetail2Trigger) {
+	// 	return;
+	// }
+	// CHAN-CBYBBF 銆愬鎵樸�戠粡閿�鍟咵T璐﹀彿鏄剧ず鐣岄潰缁存姢-骞夸笢姹囨櫒 end
 	//add by rentx 20210618 start
 	if (StaticParameter.ConsumableOrderTrigger) {
 		return;

--
Gitblit v1.9.1