From 2c229b654d0ac9478ec5e2479b244362205bd54e Mon Sep 17 00:00:00 2001
From: GWY <guweiyiscp096@foxmail.com>
Date: 星期五, 11 三月 2022 13:06:54 +0800
Subject: [PATCH] 产品和注册证时间变更

---
 force-app/main/default/classes/ProRegisterHandler.cls     |    4 +++-
 force-app/main/default/classes/Product2TriggerHandler.cls |    5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/force-app/main/default/classes/ProRegisterHandler.cls b/force-app/main/default/classes/ProRegisterHandler.cls
index 4d568fe..65515f8 100644
--- a/force-app/main/default/classes/ProRegisterHandler.cls
+++ b/force-app/main/default/classes/ProRegisterHandler.cls
@@ -170,10 +170,12 @@
         Map<Id,String> prl1Map = new Map<Id,String>();
         Map<Id,String> prl2Map = new Map<Id,String>();
         List<ID> pidList = new List<ID>();
+        Date stedate;
+
         if (pro2Map.size()>0) {
             for (Product_Register_Link__c pr: prl1List) {
                 if (pro2Map.containsKey(pr.Product2__r.Id) && (prSteMap.containsKey(pr.Product2__r.Id) || prSte1Map.containsKey(pr.Product2__r.Id))) {
-                	Date stedate = prSteMap.get(pr.Product2__r.Id)==null?prSte1Map.get(pr.Product2__r.Id)==null?null:prSte1Map.get(pr.Product2__r.Id):prSte1Map.get(pr.Product2__r.Id);
+                	stedate = prSteMap.get(pr.Product2__r.Id)==null?prSte1Map.get(pr.Product2__r.Id)==null?null:prSte1Map.get(pr.Product2__r.Id):prSte1Map.get(pr.Product2__r.Id);
                 	pidList.add(pr.Product2__r.Id);
                     if (pr.Product2__r.demoteer_Sap__c <> null && pr.Product2__r.Diedatvanink__c <> null) {
                     	if (pr.Product_Register__r.Stelsedag__c <> null) {
diff --git a/force-app/main/default/classes/Product2TriggerHandler.cls b/force-app/main/default/classes/Product2TriggerHandler.cls
index a429749..79b7947 100644
--- a/force-app/main/default/classes/Product2TriggerHandler.cls
+++ b/force-app/main/default/classes/Product2TriggerHandler.cls
@@ -102,12 +102,13 @@
         System.debug('pro2Map='+pro2Map);
         System.debug('prSteMap='+prSteMap);
         System.debug('prSte1Map='+prSte1Map);
-        
+        Date stedate;
+
         //閫氳繃涓婇潰鐨勫惊鐜紝鎶婂叧绯昏〃杩囪幏鍙栫殑鏁版嵁璇诲嚭鏉ワ紝浼犵粰map
         if (pro2Map.size()>0) {
             for (Product_Register_Link__c pr: pro2List) {
                 if (pro2Map.containsKey(pr.Product2__r.Id) && (prSteMap.containsKey(pr.Product2__r.Id) || prSte1Map.containsKey(pr.Product2__r.Id))) {
-                    Date stedate = prSteMap.get(pr.Product2__r.Id)==null?prSte1Map.get(pr.Product2__r.Id)==null?null:prSte1Map.get(pr.Product2__r.Id):prSte1Map.get(pr.Product2__r.Id);
+                    stedate = prSteMap.get(pr.Product2__r.Id)==null?prSte1Map.get(pr.Product2__r.Id)==null?null:prSte1Map.get(pr.Product2__r.Id):prSte1Map.get(pr.Product2__r.Id);
                     if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <> null && pr.Product2__r.Diedatvanink__c <> null) {
                         if (pr.Product_Register__r.Stelsedag__c <> null) {
                             if (pr.Product2__r.Diedatvanink__c <= stedate) {

--
Gitblit v1.9.1