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/SpareIsLoanBatch.cls | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/force-app/main/default/classes/SpareIsLoanBatch.cls b/force-app/main/default/classes/SpareIsLoanBatch.cls
index c34592e..976b982 100644
--- a/force-app/main/default/classes/SpareIsLoanBatch.cls
+++ b/force-app/main/default/classes/SpareIsLoanBatch.cls
@@ -6,6 +6,8 @@
Boolean IsNeedExecute = false; // 2021-06-07 mzy WLIG-BYHD79 SFDC鐜batch鍚堝苟璋冩煡 鏄惁绗﹀悎鎵ц鏉′欢
+ Integer daysBefore = 2; // 2023-01-05 ssm 鎶ュ憡澶浜嗭紝闇�瑕佸鍔犻檺鍒�
+
//榛樿鎵ц涓烘棤鍙�
global SpareIsLoanBatch() {
@@ -20,6 +22,12 @@
this.IsNeedExecute = needExecute;
}
// 2021-06-07 mzy WLIG-BYHD79 SFDC鐜batch鍚堝苟璋冩煡 end
+
+ // 2023-01-05 ssm 涓烘姤鍛婂鍔犻檺鍒讹紝澶勭悊鍘嗗彶鏁版嵁 start
+ global SpareIsLoanBatch(Integer days) {
+ this.daysBefore = days;
+ }
+ // 2023-01-05 ssm 涓烘姤鍛婂鍔犻檺鍒讹紝澶勭悊鍘嗗彶鏁版嵁 end
global Database.QueryLocator start(Database.BatchableContext BC) {
if (oppIdListBatch == null || oppIdListBatch.size() == 0 ) {
@@ -174,9 +182,11 @@
}
}
-
+ // 2023-01-05 ssm 澧炲姞闄愬埗锛屾姤鍛婅瀹℃壒閫氳繃鐨勶紝鏈�鍚庢洿鏂版棩鍦�2澶╁唴鐨�
+ // 涓哄鐞嗗巻鍙叉暟鎹紝璁剧疆鎴愬彲浠ヨ皟鏁寸殑鏍峰瓙
+ Datetime start_at = this.daysBefore != null && this.daysBefore > 0 ? Datetime.now().addDays(0 - this.daysBefore) : Datetime.now().addDays(-2);
List<Report__c> raLists = [Select Id,Loaner_request_no1__c,Loaner_request_no1__r.OPDAmount__c
- from Report__c where Loaner_request_no1__c != null ];
+ from Report__c where Loaner_request_no1__c != null and Status__c = '鎵瑰噯' and LastModifiedDate >= :start_at];
for (Report__c ra: raLists) {
--
Gitblit v1.9.1