From e3c02c03dd2de442bbced87236f60a13a1cd154e Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期四, 02 三月 2023 17:51:57 +0800
Subject: [PATCH] gzw 正式环境最新代码更新

---
 force-app/main/default/classes/MceConfigPDFController.cls |   36 ++++++++++++++++++++++++++++++++++--
 1 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/force-app/main/default/classes/MceConfigPDFController.cls b/force-app/main/default/classes/MceConfigPDFController.cls
index f1a04e4..b5adea4 100644
--- a/force-app/main/default/classes/MceConfigPDFController.cls
+++ b/force-app/main/default/classes/MceConfigPDFController.cls
@@ -6,8 +6,9 @@
     /** 1銉氥兗銈搞伀琛ㄧず銇欍倠鏄庣窗銇暟銇с仚銆� */
     //public Boolean HideOrNot{ get; private set; }
     private Integer rowSize = 35;   // TODO 銈偣銈裤儬銉┿儥銉伀瀹氱京
-    
-    private Integer nameMax = 20;   //鍚嶇О鏈�澶ч暱搴� 鍏ㄦ槸涓枃鐨勮瘽 鏈�澶�18 浣嗗洜涓轰笉浼氬叏鏄腑鏂� 鎵�浠ヨ涓�20
+    // XLIU-CE654V update by thh 20220507 start
+    private Integer nameMax = 23;   //鍚嶇О鏈�澶ч暱搴� 鍏ㄦ槸涓枃鐨勮瘽 鏈�澶�18 浣嗗洜涓轰笉浼氬叏鏄腑鏂� 鎵�浠ヨ涓�20
+    // XLIU-CE654V update by thh 20220507 end
     private Integer commentMax = 5; //澶囨敞鏈�澶ч暱搴�
     //private Integer modelNoMax = 9; //鍨嬪彿鏈�澶ч暱搴�
 
@@ -17,6 +18,9 @@
     //private Integer lastRowSize = 24;
     /** 鍗板埛銇欍倠銉氥兗銈告暟銇с仚銆� */
     //public Integer maxPageNumber { get; private set; }
+    //2021-11-30 fy add LJPH-C8W8FV 缃《 start
+    public List<String> TopProductModel =new List<String>();
+    //2021-11-30 fy add LJPH-C8W8FV 缃《 end
 
     public String  RecordTypeName { get; private set; }
     public Integer year { get; private set; }
@@ -33,6 +37,14 @@
     public MceConfigPDFController(ApexPages.StandardController controller) {
     }
     public void init() {
+        //2021-11-30 fy add LJPH-C8W8FV 缃《 start
+        TopProductModel.add('CF-LV1I');
+        TopProductModel.add('CF-LV1L');
+        TopProductModel.add('CV-V1');
+        TopProductModel.add('GIF-LV1');
+        TopProductModel.add('OER-AW');
+        TopProductModel.add('OER-A');
+        //2021-11-30 fy add LJPH-C8W8FV 缃《 end
         String targetEstimateId = ApexPages.currentPage().getParameters().get('id');
         flag = ApexPages.currentPage().getParameters().get('flag');
         // 瑕嬬鎯呭牨銈掑彇寰椼�佸繀銇氥亗銈嬨伅銇�
@@ -62,6 +74,12 @@
         // 鏄庣窗銇ō瀹�
         Integer cnt = 0;
         List<Maintenance_Contract_Asset_Estimate__c> MaintenanceCAE = [SELECT Id, Name, Asset__c, Maintenance_Contract_Estimate__r.Department__c,
+                        //2021-11-30 fy add LJPH-C8W8FV 缃《 start
+                        Asset__r.OwnershipMachine_No__c,
+                        //2021-11-30 fy add LJPH-C8W8FV 缃《 end
+                        //2021-11-30 fy add LJPH-C8W8FV 缃《 start
+                        Product_Manual__r.Asset_Model_No__c,
+                        //2021-11-30 fy add LJPH-C8W8FV 缃《 end
                         Asset__r.Name, Asset__r.SerialNumber, Asset__r.InstallDate,
                         Asset__r.Product2.Name,
                         Product_Manual__c, Product_Manual__r.Name, IsNew__c,
@@ -72,6 +90,20 @@
                   WHERE Maintenance_Contract_Estimate__c = :this.targetObj.estimate.Id
                   ORDER BY Product_Manual__c, Asset__r.SerialNumber, Asset__r.Name, Asset__r.Department_Name__c, Asset__r.InstallDate];
                   system.debug('妫�鏌�::::::'+MaintenanceCAE);
+                //2021-11-30 fy add LJPH-C8W8FV 缃《 start
+                List<Maintenance_Contract_Asset_Estimate__c> topAsset =new List<Maintenance_Contract_Asset_Estimate__c>();
+                List<Maintenance_Contract_Asset_Estimate__c> otherAsset =new List<Maintenance_Contract_Asset_Estimate__c>();
+                
+                for(Maintenance_Contract_Asset_Estimate__c tarAsse : MaintenanceCAE){
+                    if(TopProductModel.contains(tarAsse.Asset__r.OwnershipMachine_No__c)||TopProductModel.contains(tarAsse.Product_Manual__r.Asset_Model_No__c)){
+                        topAsset.add(tarAsse);
+                    }else{
+                        otherAsset.add(tarAsse);
+                    }
+                }
+                topAsset.addAll(otherAsset);
+                MaintenanceCAE=topAsset;
+                //2021-11-30 fy add LJPH-C8W8FV 缃《 end
         for(Maintenance_Contract_Asset_Estimate__c mcae :MaintenanceCAE) {
             //for(Integer a=0;a<50;a++){
             //tmpTargetObj.addAssetInfo(mcae);

--
Gitblit v1.9.1