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/SelectAssetExtension.cls |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/classes/SelectAssetExtension.cls b/force-app/main/default/classes/SelectAssetExtension.cls
index 318c74f..2a1b9b1 100644
--- a/force-app/main/default/classes/SelectAssetExtension.cls
+++ b/force-app/main/default/classes/SelectAssetExtension.cls
@@ -58,22 +58,39 @@
         // 绱嶅叆姗熷櫒銇儏鍫便倰鍙栧緱
         if ( this.targetHospitalId == null || ( this.targetHospitalId.length() != 15 && this.targetHospitalId.length() != 18)) {
             //this.assetRecords  = new List<Asset>();
+            system.debug('assetRecords123456789==' + assetRecords);
         } else {
             // HWAG-BHD66X start
             assetRecords = [SELECT Id, Name, CheckBox__c, SerialNumber,TransferToOther__c	/*涓存椂鐢�*/,
                             Department_Name__c, Installation_Site__c, Posting_Date__c,
                             Asset_Owner__c,	Product2Id
                             // Gzw 20200826 淇濆瓨涓婁竴鏈熷悎鍚屼复鏃剁敤 start
-                            , Remarks__c
+                            , Remarks__c,MDM_Model_No__c
                             // Gzw 20200826 淇濆瓨涓婁竴鏈熷悎鍚屼复鏃剁敤 end
                             // fxk 2021/9/17 鐐规瀵硅薄涓存椂鐢� star
                             // , Freeze_sign__c
                             // fxk 2021/9/17 鐐规瀵硅薄涓存椂鐢� end
                             FROM Asset
                             WHERE Hospital__c = :this.targetHospitalId
+                                                // XLIU-CK46FR zyh start
+                                                AND Status != '寤冩' AND Status != '寰呮姤搴�' 
+                                                AND (Competitor_Name__c = '濂ユ灄宸存柉' OR Competitor_Name__c = '' OR Competitor_Name__c = '鍏朵粬')
+                                                AND Category1__c != 'ET'
+                                                AND (Category1__c != 'SP' OR Category2__c != '闄勫睘鍝�' )
+                                                AND (Category1__c != 'GI' OR Category2__c != '闄勫睘鍝�' OR Category4__c != 'OER' )
+                                                AND (Category1__c != 'GI' OR Category2__c != '鍏朵粬' )
+                                                AND (Category1__c != 'ENG' OR Category2__c != '闄勫睘鍝�' )
+                                                AND (Category1__c != 'ENG' OR Category2__c != '鑰楁潗' )
+                                                // AND (Category1__c != 'SP' OR Category2__c != '闄勫睘鍝�' )
+                                                // AND (Category1__c != 'GI' OR (Category2__c != '闄勫睘鍝�' OR Category2__c != '鍏朵粬') )
+                                                // AND (Category1__c != 'ENG' OR (Category2__c != '闄勫睘鍝�' OR Category2__c != '鑰楁潗') )
+                                                // AND AssetMark__c != '鑰楁潗' 
+                                                // XLIU-CK46FR zyh end
                                                 AND ( AssetMark__c != '鑰楁潗' OR Product2.Family != 'ET' )
-                                                ORDER BY Department_Name__c, Posting_Date__c, SerialNumber];
-            system.debug('assetRecords123456789' + assetRecords);
+                                                ORDER BY Department_Name__c, Posting_Date__c, SerialNumber
+                                                ];
+            // system.debug('assetRecords123456789' + assetRecords);
+            system.debug('assetRecords123456789' + assetRecords.size());
             // HWAG-BHD66X end
         }
 
@@ -81,7 +98,7 @@
         this.selectedAsset = [SELECT Id, Name, Check_object__c, Maintenance_Contract__c, LastMContract__c, Asset__c FROM Maintenance_Contract_Asset__c WHERE Maintenance_Contract__c = :this.targetContractId];
         system.debug('selectedAsset==========>'+selectedAsset);
         //Maintenance_Contract_Asset_Estimate__c
-        this.selectedAsset2 = [SELECT Id, Name,Product_Manual__c, Check_object__c,Maintenance_Contract_Estimate__r.Maintenance_Contract__c,Asset__c,Asset__r.product2Id 
+        this.selectedAsset2 = [SELECT Id, Name,Product_Manual__c,Product_Manual__r.MDM_Model_No__c, Check_object__c,Maintenance_Contract_Estimate__r.Maintenance_Contract__c,Asset__c,Asset__r.product2Id 
         FROM Maintenance_Contract_Asset_Estimate__c WHERE Maintenance_Contract_Estimate__r.Maintenance_Contract__c = :this.targetContractId];
         system.debug('selectedAsset2==========>'+selectedAsset2);
         //SELECT Id, Name, Check_object__c, Asset__c FROM Maintenance_Contract_Asset_Estimate__c WHERE 	Maintenance_Contract_Estimate__r.Maintenance_Contract__c = 'a0H1m000002shhL'
@@ -106,7 +123,7 @@
                 }
             }
             for(Maintenance_Contract_Asset_Estimate__c selectedLocal : this.selectedAsset2){
-                if(local.Product2Id == selectedLocal.Product_Manual__c){
+                if(local.MDM_Model_No__c == selectedLocal.Product_Manual__r.MDM_Model_No__c){
                     //local.TransferToOther__c = true;
                     local.TransferToOther__c = selectedLocal.Check_object__c;
                     system.debug('TransferToOther__c============>'+local.TransferToOther__c);

--
Gitblit v1.9.1