From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新
---
force-app/main/default/classes/NextMonthVisitBatch.cls | 34 ++++------------------------------
1 files changed, 4 insertions(+), 30 deletions(-)
diff --git a/force-app/main/default/classes/NextMonthVisitBatch.cls b/force-app/main/default/classes/NextMonthVisitBatch.cls
index a999dfd..29c74cf 100644
--- a/force-app/main/default/classes/NextMonthVisitBatch.cls
+++ b/force-app/main/default/classes/NextMonthVisitBatch.cls
@@ -10,7 +10,6 @@
//鐢ㄤ簬鎵цbatch鍚屾椂璁板綍鏃ュ織淇℃伅
private BatchIF_Log__c iflog;
- Boolean IsNeedExecute = false; // 2021-03-09 mzy WLIG-BYHD79 SFDC鐜batch鍚堝苟璋冩煡 鏄惁绗﹀悎鎵ц鏉′欢
global NextMonthVisitBatch() {
@@ -22,17 +21,6 @@
iflog.ErrorLog__c = '';
insert iflog;
}
- // 2021-03-09 mzy WLIG-BYHD79 SFDC鐜batch鍚堝苟璋冩煡 start
- global NextMonthVisitBatch(Boolean NeedExecute) {
- this.IsNeedExecute = NeedExecute;
- iflog = new BatchIF_Log__c();
- iflog.Type__c = 'PushNotification';
- iflog.Is_Error__c = 0;
- iflog.Log__c = 'NextMonthVisitBatch start1\n';
- iflog.ErrorLog__c = '';
- insert iflog;
- }
- // 2021-03-09 mzy WLIG-BYHD79 SFDC鐜batch鍚堝苟璋冩煡 end
global NextMonthVisitBatch(String oppoId) {
this.oppoId = oppoId;
iflog = new BatchIF_Log__c();
@@ -65,30 +53,17 @@
global Database.QueryLocator start(Database.BatchableContext bc) {
- // String query ='select id from Opportunity where IsNextMonthOfVisit__c =true';
- //String query ='select id from Opportunity where IsNextMonthOfVisit__c =true OR IsThisMonthOfVisit__c = true'; //20201214 zh CHAN-BW35VV
- String query ='select id from Opportunity where (IsNextMonthOfVisit__c =true OR IsThisMonthOfVisit__c = true)'; // 2021-03-10 mzy WLIG-BYHD79
+ String query ='select id from Opportunity where IsNextMonthOfVisit__c =true';
if (!string.isblank(oppoId)) {
- query += ' and id = :oppoId';
+ query += ' and id = :oppoId ';
}
if (oppoList != null) {
- query += ' and id in :oppoList ';
+ query += ' and id in: oppoList ';
}
+ System.debug('sql璇彞锛�'+query);
- // 2021-03-09 mzy WLIG-BYHD79 SFDC鐜batch鍚堝苟璋冩煡 start
- // 姣忔湀鏈�鍚庝竴澶� 杩愯 涓嶆弧瓒宠繍琛屾椂闂达紝鍙互浣挎煡璇㈠埌鐨勭粨鏋滀负绌�
- //鑾峰彇杩欎釜鏈堢殑鏈�鍚庝竴澶�
- Date toDate = Date.today();
- Date days = Date.newInstance(toDate.year(), toDate.month() + 1, 0);
- Integer monDays = days.day();
- Date dayEnd = Date.newInstance(toDate.year(), toDate.month(), monDays);
-
- if(toDate != dayEnd && IsNeedExecute == true){
- query = 'Select Id from Opportunity where Name = \'\' AND Name != \'\' ';
- }
- //2021-03-09 mzy WLIG-BYHD79 SFDC鐜batch鍚堝苟璋冩煡 end
return Database.getQueryLocator(query);
}
@@ -101,7 +76,6 @@
Opportunity oppo = new Opportunity();
oppo.Id = o.Id;
oppo.IsNextMonthOfVisit__c = false;
- oppo.IsThisMonthOfVisit__c = false;//20201214 zh CHAN-BW35VV
opportunityList.add(oppo);
}
if (opportunityList.size() > 0){
--
Gitblit v1.9.1