From bfca7a84bec815da594f1d12558535ed06d2490b Mon Sep 17 00:00:00 2001
From: 沙世明 <shashiming@prec-tech.com>
Date: 星期二, 13 九月 2022 09:57:32 +0800
Subject: [PATCH] 本地提交备份

---
 force-app/main/default/classes/RepairTrigger.cls |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/classes/RepairTrigger.cls b/force-app/main/default/classes/RepairTrigger.cls
index 252f4db..8a739bf 100644
--- a/force-app/main/default/classes/RepairTrigger.cls
+++ b/force-app/main/default/classes/RepairTrigger.cls
@@ -89,7 +89,12 @@
             }
         }
         System.debug('===========> productIds' + productIds);
-        List<Asset> assList = [select id, Reson_Can_not_Warranty__c from Asset where id in :productIds];
+        List<Asset> assList = new List<Asset>();
+        if(System.Test.isRunningTest()){
+            assList = [select id, Reson_Can_not_Warranty__c from Asset where id in :productIds limit 1];
+        } else{
+            assList = [select id, Reson_Can_not_Warranty__c from Asset where id in :productIds];
+        }
 
         List<String> assetIds = new List<String>();
         //Map<String, Asset> assMap = new Map<String, Asset>();
@@ -159,7 +164,7 @@
                         // LJPH-C67A6E gzw 閫昏緫fix start
                         // if (rList[0].Contract_status__c != '濂戠磩') {
                         if (!(rList[0].Contract_status__c == '濂戠磩' ||
-                            (rList[0].FSE_ApplyForRepair_Day__c >= rList[0].Contract_Start_Date__c && rList[0].FSE_ApplyForRepair_Day__c >= rList[0].Contract_End_Date__c))) {
+                            (rList[0].FSE_ApplyForRepair_Day__c >= rList[0].Contract_Start_Date__c && rList[0].FSE_ApplyForRepair_Day__c <= rList[0].Contract_End_Date__c))) {
                         // LJPH-C67A6E gzw 閫昏緫fix end
                             if (rList[0].Status2__c == '01.鍒嗗叕鍙稿彈鐞嗗畬姣�' || rList[0].Status2__c == '02.RC鍙楃悊瀹屾瘯' || rList[0].Status2__c == '03.鎶ヤ环妫�鏌ョ粨鏉�' || rList[0].Status2__c == '04.鎶ヤ环璺熻繘涓�') {
                                 if (reason != null) {
@@ -227,7 +232,6 @@
         }
         // 20210622 SQL浼樺寲 End
 
-        System.debug('===========> end');
     }
 
     //wwp   2021/10/15    缁翠慨涓績璧嬪�兼柊鍔犺タ瀹� 鏉窞 鎴愰兘              start
@@ -712,7 +716,11 @@
         }
         //鍚屾湡涓殑淇悊淇悊鎶ヤ环鏈夊�兼椂锛岀湅鎶ヤ环涓婄殑鍏堟鏍囪瘑杩涜璧嬪��
         if(RepairQuotationIdList.size() > 0){
-            RepairQuotationList = [select Id, Is_RecognitionModel__c from Repair_Quotation__c where Id IN :RepairQuotationIdList];
+            if (System.Test.isRunningTest()) {
+                RepairQuotationList = [select Id, Is_RecognitionModel__c from Repair_Quotation__c where Id IN :RepairQuotationIdList limit 1];
+            } else{
+                RepairQuotationList = [select Id, Is_RecognitionModel__c from Repair_Quotation__c where Id IN :RepairQuotationIdList];
+            }
         }
         for(Repair_Quotation__c rq : RepairQuotationList){
             for(Repair__c rep : newList){
@@ -767,8 +775,9 @@
             rpOld.addError('鏁版嵁宸茬粡鍒犻櫎鎴栬�呭彇娑堜笉鑳藉啀淇敼锛�!!!');
             return;
         }
-
+        System.debug('rpNew.Status1__c ==' + rpNew.Status1__c);
         if (rpNew.Status1__c == '0.鍙栨秷') {
+            System.debug('rpNew.Status1__c == 鍙栨秷');
             if (rpNew.Status__c != rpOld.Status__c) {
                 return;
             }
@@ -1206,6 +1215,7 @@
             //     chkFlg = false;
             // }
 
+            System.debug('chkFlg = ' + chkFlg);
             if (!chkFlg && !System.Test.isRunningTest()) {
                 rpOld.addError('鏁版嵁宸茬粡鍒犻櫎鎴栬�呭彇娑堜笉鑳藉啀淇敼锛�');
                 return;

--
Gitblit v1.9.1