From 4420517bbbffea48cabe7a7dcdf2e1c4b440fc85 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 30 五月 2022 16:15:26 +0800
Subject: [PATCH] 两个LS特殊条件在说明的增减
---
force-app/main/default/classes/OrderTriggerHandler.cls | 536 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 518 insertions(+), 18 deletions(-)
diff --git a/force-app/main/default/classes/OrderTriggerHandler.cls b/force-app/main/default/classes/OrderTriggerHandler.cls
index ad164af..3bdf83f 100644
--- a/force-app/main/default/classes/OrderTriggerHandler.cls
+++ b/force-app/main/default/classes/OrderTriggerHandler.cls
@@ -360,6 +360,11 @@
newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c;
newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c;
newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c;
+ // PIPL Update 20220420 By Chen Yanan Start
+ newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c;
+ newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c;
+ newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c;
+ // PIPL Update 20220420 By Chen Yanan End
newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c;
newOrd.SpecialWarranty_D__c = newOrd.SpecialWarranty__c;
newOrd.DealerProfit_D__c = newOrd.DealerProfit__c;
@@ -425,7 +430,7 @@
}
public static void setPriceBook(List<Order> newList, Map<Id, Order> newMap, List<Order> oldList, Map<Id, Order> oldMap) {
-
+
List<String> oppidList = new List<String>();
for (Order o : newList) {
oppidList.add(o.OpportunityId);
@@ -1316,12 +1321,21 @@
}
if (newOrd.SpecialDeliveryContact__c != oldOrd.SpecialDeliveryContact__c) {
newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c;
+ // PIPL Update 20220420 By Chen Yanan Start
+ newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c;
+ // PIPL Update 20220420 By Chen Yanan End
}
if (newOrd.SpecialDeliveryPhone__c != oldOrd.SpecialDeliveryPhone__c) {
newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c;
+ // PIPL Update 20220420 By Chen Yanan Start
+ newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c;
+ // PIPL Update 20220420 By Chen Yanan End
}
if (newOrd.SpecialDeliveryAddress__c != oldOrd.SpecialDeliveryAddress__c) {
newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c;
+ // PIPL Update 20220420 By Chen Yanan Start
+ newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c;
+ // PIPL Update 20220420 By Chen Yanan End
}
if (newOrd.SpecialParkage__c != oldOrd.SpecialParkage__c) {
newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c;
@@ -1637,6 +1651,11 @@
newOrd.SpecialDeliveryContact__c = newOrd.SpecialDeliveryContact_D__c;
newOrd.SpecialDeliveryPhone__c = newOrd.SpecialDeliveryPhone_D__c;
newOrd.SpecialDeliveryAddress__c = newOrd.SpecialDeliveryAddress_D__c;
+ // PIPL Update 20220420 By Chen Yanan Start
+ newOrd.SpecialDeliveryContact_Encrypted__c = newOrd.SpecialDeliveryContact_D_Encrypted__c;
+ newOrd.SpecialDeliveryPhone_Encrypted__c = newOrd.SpecialDeliveryPhone_D_Encrypted__c;
+ newOrd.SpecialDeliveryAddress_Encrypted__c = newOrd.SpecialDeliveryAddress_D_Encrypted__c;
+ // PIPL Update 20220420 By Chen Yanan End
newOrd.SpecialParkage__c = newOrd.SpecialParkage_D__c;
newOrd.SpecialWarranty__c = newOrd.SpecialWarranty_D__c;
newOrd.DealerProfit__c = newOrd.DealerProfit_D__c;
@@ -1765,6 +1784,11 @@
newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c;
newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c;
newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c;
+ // PIPL Update 20220420 By Chen Yanan Start
+ newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c;
+ newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c;
+ newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c;
+ // PIPL Update 20220420 By Chen Yanan End
newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c;
newOrd.SpecialWarranty_D__c = newOrd.SpecialWarranty__c;
newOrd.DealerProfit_D__c = newOrd.DealerProfit__c;
@@ -1806,6 +1830,9 @@
newOrd.Contract_StatusD__c = newOrd.Contract_Status__c;
newOrd.ProductConfig_D__c = newOrd.ProductConfig__c;
+ // PIPL Update 20220420 By Chen Yanan Start
+ newOrd.SpecialDeliveryPhone_Encrypted__c = newOrd.SpecialDeliveryPhone_D_Encrypted__c;
+ // PIPL Update 20220420 By Chen Yanan End
if (newOrd.Upload_IsChanged__c == true) {
newOrd.Upload_IsChanged__c = false;
@@ -1898,6 +1925,12 @@
if (newOrder.SP_33__c == true && oldOrder.SP_33__c == false) {
newOrder.Description += sObjectFieldMaps.get('SP_33__c').getDescribe().getLabel() + ' \r\n ';
}
+ if (newOrder.SP_32__c == true && oldOrder.SP_32__c == false) {
+ newOrder.Description += sObjectFieldMaps.get('SP_32__c').getDescribe().getLabel() + ' \r\n ';
+ }
+ if (newOrder.SP_31__c == true && oldOrder.SP_31__c == false) {
+ newOrder.Description += sObjectFieldMaps.get('SP_31__c').getDescribe().getLabel() + ' \r\n ';
+ }
if (newOrder.SP_11__c == true && oldOrder.SP_11__c == false) {
newOrder.Description += sObjectFieldMaps.get('SP_11__c').getDescribe().getLabel() + ' \r\n ';
}
@@ -1963,6 +1996,12 @@
}
if (newOrder.SP_33__c == false && oldOrder.SP_33__c == true) {
newOrder.Description = newOrder.Description.remove(sObjectFieldMaps.get('SP_33__c').getDescribe().getLabel() + ' \r\n ');
+ }
+ if (newOrder.SP_32__c == false && oldOrder.SP_32__c == true) {
+ newOrder.Description = newOrder.Description.remove(sObjectFieldMaps.get('SP_32__c').getDescribe().getLabel() + ' \r\n ');
+ }
+ if (newOrder.SP_31__c == false && oldOrder.SP_31__c == true) {
+ newOrder.Description = newOrder.Description.remove(sObjectFieldMaps.get('SP_31__c').getDescribe().getLabel() + ' \r\n ');
}
if (newOrder.SP_11__c == false && oldOrder.SP_11__c == true) {
newOrder.Description = newOrder.Description.remove(sObjectFieldMaps.get('SP_11__c').getDescribe().getLabel() + ' \r\n ');
@@ -2063,15 +2102,15 @@
newOrder.BS_AsistBGenManger_BS__c = u.BS_AsistBGenManger__c == null ? u.Id : u.BS_AsistBGenManger__c;
newOrder.BS_AsistGenManger_BS__c = u.BS_AsistGenManger__c == null ? u.Id : u.BS_AsistGenManger__c;
- newOrder.BS_MandAGM__c = u.BS_Manager__c == u.BS_AsistGenManger__c ? true : false;
- newOrder.BS_AGMandD__c = u.BS_AsistGenManger__c == u.BS_Department__c ? true : false;
- newOrder.BS_DandAB__c = u.BS_Department__c == u.BS_AsistBGenManger__c ? true : false;
+ newOrder.BS_MandAGM__c = u.BS_Manager__c == u.BS_AsistBGenManger__c ? true : false;
+ //newOrder.BS_MandAGM__c = u.BS_Manager__c == u.BS_AsistGenManger__c ? true : false;
+ //newOrder.BS_AGMandD__c = u.BS_AsistGenManger__c == u.BS_Department__c ? true : false;
+ //newOrder.BS_DandAB__c = u.BS_Department__c == u.BS_AsistBGenManger__c ? true : false;
newOrder.BS_ABGandBD__c = u.BS_AsistBGenManger__c == u.BS_BDepartment__c ? true : false;
newOrder.BS_BDandIND__c = u.BS_BDepartment__c == u.BS_INDepartment__c ? true : false;
newOrder.BS_INDandGM__c = u.BS_INDepartment__c == u.BS_GeneralManager__c ? true : false;
}
}
-
if (newOrder.ProductSegment__c != 'BS') {
newOrder.SalesOwner_BS__c = newOrder.OpportunityOwnerId__c;
@@ -2092,6 +2131,14 @@
}
//}
}
+
+ for (Order newOrder : newList) {
+ if (newOrder.ProductSegment__c == 'BS') {
+ newOrder.BS_AGMandD__c = newOrder.BS_Manager_BS__c == newOrder.SalesOwner_BS__c ? true : false;
+ newOrder.BS_DandAB__c = newOrder.BS_Department_BS__c == newOrder.SalesOwner_BS__c ? true : false;
+ }
+ }
+
}
@@ -2628,13 +2675,13 @@
// 鍚堝悓-鍙樻洿鐢宠-鍘熷悎鍚屾棤鏁堟垨鑰呮墜鍔ㄤ慨鏀瑰鑷村悎鍚屾棤鏁�
if (!approveStatus && status) {
- if(newOrd.oldOrder__c){
+ /*if(newOrd.oldOrder__c){
RadiationUtil.oldOrder = true;
if (updateFlag) {
newOrd.oldOrder__c = false;
}
- }
+ }*/
RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'鏃犳晥鎴栧彉鏇存棤鏁�',newOrd.LastModifiedById );
}
@@ -2651,12 +2698,12 @@
if (RadiationUtil.EscapeOrderTriggerHandler) {
RadiationUtil.EscapeOrderTriggerHandler = false;
- if(newOrd.oldOrder__c){
+ /*if(newOrd.oldOrder__c){
RadiationUtil.oldOrder = true;
if (updateFlag) {
newOrd.oldOrder__c = false;
}
- }
+ }*/
RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'鍚堝悓鍙樻洿鑽夋涓�',newOrd.LastModifiedById );
}
@@ -2670,43 +2717,43 @@
Boolean status = newOrd.Status__c != oldOrd.Status__c && newOrd.Status__c == 'Inactive';
// 鍚堝悓鎻愪氦鐘舵�佸彉鎴愭棤鏁�
if ( status ) {
- if(newOrd.oldOrder__c){
+ /*if(newOrd.oldOrder__c){
RadiationUtil.oldOrder = true;
if (updateFlag) {
newOrd.oldOrder__c = false;
}
- }
+ }*/
RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'鍚堝悓鎻愪氦鍙樻棤鏁�',newOrd.LastModifiedById );
}
} else if (newOrd.ApproveStatus__c == 'CancelPass' && newOrd.Status__c == 'Active') {
// 鍚堝悓-鍚堝悓鎵瑰噯鈫掆啋鈫掑悎鍚屽彇娑�
if ( approveStatus && newOrd.BeforeSubmitStatus__c == 'OrderPass') {
- if(newOrd.oldOrder__c){
+ /*if(newOrd.oldOrder__c){
RadiationUtil.oldOrder = true;
if (updateFlag) {
newOrd.oldOrder__c = false;
}
- }
+ }*/
RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'鍚堝悓鍙栨秷',newOrd.LastModifiedById );
}
} else if (oldOrd.ApproveStatus__c == 'OrderSubmit' && newOrd.ApproveStatus__c == 'OrderReject' && newOrd.Status__c == 'Active') {
// 鍚堝悓鎻愪氦鈫掆啋鈫掑悎鍚岄┏鍥�
- if(newOrd.oldOrder__c){
+ /*if(newOrd.oldOrder__c){
RadiationUtil.oldOrder = true;
if (updateFlag) {
newOrd.oldOrder__c = false;
}
- }
+ }*/
RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'鍚堝悓椹冲洖',newOrd.LastModifiedById );
} else if (oldOrd.ApproveStatus__c == 'OrderSubmit' && newOrd.ApproveStatus__c == 'OrderDraft' && newOrd.Status__c == 'Active') {
// 鍚堝悓鎻愪氦鈫掆啋鈫掑悎鍚岃皟鍥�
- if(newOrd.oldOrder__c){
+ /*if(newOrd.oldOrder__c){
RadiationUtil.oldOrder = true;
if (updateFlag) {
newOrd.oldOrder__c = false;
}
- }
+ }*/
RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'鍚堝悓璋冨洖',newOrd.LastModifiedById );
}
@@ -2824,6 +2871,8 @@
for(OpportunityContactRole oppor:role_list){
roleMap.put(oppor.OpportunityId,oppor.ContactId);
}
+ System.debug('oppidList: ' + oppidList);//Nancy 2022-04-25
+ System.debug('role_list: ' + role_list);//Nancy 2022-04-25
// 鑾峰彇绯荤粺绠$悊鍛業d
String getUserId = System.label.SystemAdmin1_2_GPI;
String errMessage = '瀹㈡埛鍚嶆垨鏈�缁堢敤鎴蜂笌璇环涓嶄竴鑷达紒';
@@ -2832,7 +2881,13 @@
System.debug(oppAccountMap.get(orOne.OpportunityId) != orOne.AccountId);
System.debug( !roleMap.containsKey(orOne.OpportunityId));
System.debug(orOne.EndUserD__c + '++'+ roleMap.get(orOne.OpportunityId));
-
+ //zhj 2022-04-22 start
+ System.debug('oppAccountMap.get(orOne.OpportunityId) = ' + oppAccountMap.get(orOne.OpportunityId));
+ System.debug('orOne.AccountId = ' + orOne.AccountId);
+ System.debug('roleMap.containsKey(orOne.OpportunityId) = ' + roleMap.containsKey(orOne.OpportunityId));
+ System.debug('orOne.EndUserD__c = ' + orOne.EndUserD__c);
+ System.debug('roleMap.get(orOne.OpportunityId) = ' + roleMap.get(orOne.OpportunityId));
+ //zhj 2022-04-22 end
if(oppAccountMap.get(orOne.OpportunityId) != orOne.AccountId || !roleMap.containsKey(orOne.OpportunityId) || orOne.EndUserD__c != roleMap.get(orOne.OpportunityId)){
// 鑾峰彇鐢ㄦ埛Id
String userId = UserInfo.getUserId().subString(0,15);
@@ -3399,6 +3454,451 @@
i++;
i++;
i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
}
}
\ No newline at end of file
--
Gitblit v1.9.1