From e38a0e2aa1542aa51a3eaaca977542ad39eac482 Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期日, 24 四月 2022 09:55:11 +0800
Subject: [PATCH] 把开发环境的多年保续签内容转移到测试环境

---
 force-app/main/default/classes/SelectAssetEstimateVMController.cls |   75 +++++++++++++++++++++++++++----------
 1 files changed, 54 insertions(+), 21 deletions(-)

diff --git a/force-app/main/default/classes/SelectAssetEstimateVMController.cls b/force-app/main/default/classes/SelectAssetEstimateVMController.cls
index 10bc607..4ea93ef 100644
--- a/force-app/main/default/classes/SelectAssetEstimateVMController.cls
+++ b/force-app/main/default/classes/SelectAssetEstimateVMController.cls
@@ -244,7 +244,13 @@
                       + 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,'
                       + 'CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__c, '
                       + 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,'
+		      //鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 start
+		      + 'CurrentContract_F__r.Gurantee_Renew_startDate__c'
+		      //鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 end
                       + 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,CurrentContract_F__r.Contract_Range__c,'
+                      //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 start
+                      + 'CurrentContract_F__r.Open_RenewalQuotation__c,'
+                      //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 end'
                       + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,AssetMark__c,NoPartRiskDate_F__c,NoPartRiskDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\' ';
         //HWAG-BDJ43R ---XHL---20190729---
         //soql +=  ' AND AssetMark__c != \'鑰楁潗\' AND Product2.Family != \'ET\' ';
@@ -593,7 +599,9 @@
                          //璺宠繃鐐规鏍囪 2021/07/28 gzw start
                          , Skip_DJ__c
                          //璺宠繃鐐规鏍囪 2021/07/28 gzw start
-    
+                         //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220419 start
+                         , Maintenance_Contract__r.Open_RenewalQuotation__c
+                         //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220419 end'
                         //LJPH-C9SCX7 銆愬鎵樸�戝悎鍚屾棤绌虹櫧鏈熺殑鎻愰啋  lt  20211221  start
                         //, Maintenance_Contract__r.Past_Contract_end_day__c //杩囧幓鍚堝悓缁撴潫鏃�
                         //LJPH-C9SCX7 銆愬鎵樸�戝悎鍚屾棤绌虹櫧鏈熺殑鎻愰啋  lt  20211221  end
@@ -737,6 +745,9 @@
                             CurrentContract_F__c, CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c, CurrentContract_F__r.RecordType_DeveloperName__c, CurrentContract_F__r.Estimate_Num__c, CurrentContract_F__r.Contract_End_Date__c, CurrentContract_F__r.Estimate_Contract_endDate__c,
                             CurrentContract_F_asset__c, CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c, CurrentContract_F_asset__r.endDateGurantee_Text__c, CurrentContract_F__r.Gurantee_Estimate_startDate__c,
                             CurrentContract_F__r.First_Estimate_Date__c,
+			    //鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 start
+			    CurrentContract_F__r.Gurantee_Renew_startDate__c,
+			    //鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 end
                             CurrentContract_F__r.Contract_Consumption_rate__c, CurrentContract_F__r.First_contract_usage_Rate__c,
                             CurrentContract_F__r.Contract_Range__c, AssetMark__c,
                             //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 start
@@ -783,6 +794,9 @@
                 Asset__r.CurrentContract_F__r.Contract_Range__c,
                 Asset__r.CurrentContract_F__r.Contract_End_Date__c,
                 Asset__r.CurrentContract_F__r.Gurantee_Estimate_startDate__c,
+		//鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 start
+		Asset__r.CurrentContract_F__r.Gurantee_Renew_startDate__c,
+		//鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 end
                 //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 start
                 Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c
                 //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 end
@@ -1098,8 +1112,14 @@
                             + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c, '
                             + 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c, CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,'
                             + 'CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__c, '
+			    //鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 start
+			    + 'CurrentContract_F__r.Gurantee_Renew_startDate__c'
+			    //鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 end
                             + 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,'
                             + 'CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,'
+                            //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 start
+                            + 'CurrentContract_F__r.Open_RenewalQuotation__c,'
+                            //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 end
                             + 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Range__c,AssetMark__c,NoPartRiskDate__c,NoPartRiskDate_F__c,Product2.PartSupplyFinishDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\' '
                             + 'AND Id NOT IN ' + notInId;
             //HWAG-B4R3SS  START 20181026
@@ -1142,8 +1162,14 @@
             sqlStr += 'CurrentContract_End_Date__c,Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,';
             sqlStr += 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,';
             sqlStr += 'CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__c,';
+	    //鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 start
+	    sqlStr += 'CurrentContract_F__r.Gurantee_Renew_startDate__c';
+	    //鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 end
             sqlStr += 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,';
             sqlStr += 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,';
+            //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 start
+            sqlStr += 'CurrentContract_F__r.Open_RenewalQuotation__c,';
+            //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 end
             sqlStr += ' CurrentContract_F__r.Contract_Range__c,AssetMark__c,NoPartRiskDate__c,NoPartRiskDate_F__c,Product2.PartSupplyFinishDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\'';
             //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start
             // sqlStr += '  AND ( AssetMark__c != \'鑰楁潗\' OR Product2.Family != \'ET\' ) ';
@@ -2552,16 +2578,16 @@
             t = this.estimate.Contract_Start_Date__c.addMonths(Integer.valueOf(this.estimate.Contract_Range__c));
             t = t.addDays(-1);
             this.estimate.Contract_End_Date__c = t;
-            //浠ユ彁浜ゆ姤浠风殑鏃剁偣锛岄攣瀹氱粡閿�鍟嗙殑鍏堟鐘舵�侊紝decide鏃朵笉鍐嶆洿鏂扮粡閿�鍟嗙殑鎬ц川 thh 20220407 start
+            //鎻愪氦涔嬪悗decide涔嬪墠锛岀粡閿�鍟嗗彉鏇寸殑璇濓紝鍏堟淇℃伅浠ュ彉鏇村悗鐨勭粡閿�鍟嗗厛娆句俊鎭墽琛� thh 20220418 start
             //add      wangweipeng                   2021/12/26                     start
-            // if(String.isNotBlank(this.estimate.Dealer__c)){
-            //     checkDealerId = this.estimate.Dealer__c;
-            //     onChDealerUpdate();
-            // }else{
-            //     this.estimate.Is_RecognitionModel__c = false;
-            // }
+            if(String.isNotBlank(this.estimate.Dealer__c)){
+                checkDealerId = this.estimate.Dealer__c;
+                onChDealerUpdate();
+            }else{
+                this.estimate.Is_RecognitionModel__c = false;
+            }
             //add      wangweipeng                   2021/12/26                     end
-            //浠ユ彁浜ゆ姤浠风殑鏃剁偣锛岄攣瀹氱粡閿�鍟嗙殑鍏堟鐘舵�侊紝decide鏃朵笉鍐嶆洿鏂扮粡閿�鍟嗙殑鎬ц川 thh 20220407 end
+            //鎻愪氦涔嬪悗decide涔嬪墠锛岀粡閿�鍟嗗彉鏇寸殑璇濓紝鍏堟淇℃伅浠ュ彉鏇村悗鐨勭粡閿�鍟嗗厛娆句俊鎭墽琛� thh 20220418 end
             System.debug('---------345----'+this.estimate.Dealer__c+'-------'+this.estimate.Dealer__r.FirstParagraphEnd__c);
             // 浣嶇疆璋冩暣 鍦�1951 line
             // Date createdDate = this.estimate.CreatedDate == null ? System.today() : this.estimate.CreatedDate.date();
@@ -3063,18 +3089,25 @@
                         rtn = false;
                     }
                 }
-                // 澶氬勾淇濆垽鏂�
-                if (String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') {
-                    //if (UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') {
-    
-                    //Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c);
-                    //Decimal monthCon = (Decimal)noOfDays/365*12;
-                    // 鍙紑濮嬫姤浠风殑鏈堟暟闄愬埗
-                    if (input.rec.CurrentContract_F__r.Gurantee_Estimate_startDate__c > Date.today()) {
-                        input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 鍚堝悓缁撴潫鍓�6涓湀寮�濮嬪彲浠ュ埗浣滄姤浠枫��');
-                        rtn = false;
-                    }
-                }
+		// 澶氬勾淇濆垽鏂�
+		if ( String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') {
+			//if (UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') {
+	
+			//Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c);
+			//Decimal monthCon = (Decimal)noOfDays/365*12;
+			// 鍙紑濮嬫姤浠风殑鏈堟暟闄愬埗
+			//鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 start
+			// if (input.rec.CurrentContract_F__r.Gurantee_Estimate_startDate__c > Date.today()) {
+			// 	input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 鍚堝悓缁撴潫鍓�6涓湀寮�濮嬪彲浠ュ埗浣滄姤浠枫��');
+			// 	rtn = false;
+			// }
+			if (input.rec.CurrentContract_F__r.Gurantee_Renew_startDate__c > Date.today()) {
+				input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 绗竴涓澶囩粨鏉熷悗鍙互鍒朵綔鎶ヤ环銆�');
+				rtn = false;
+			}
+			//鍙樻洿澶氬勾淇濈画绛惧紑濮嬫棩 thh 20220315 end
+
+		}
                 //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, '---' + input.rec.CurrentContract_F__r.Contract_End_Date__c));
                 if (inDicideFlag && String.isNotBlank(input.rec.CurrentContract_F__c) && estimate.Skip_DJ__c == false ) {
                     //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, '+++' + input.rec.CurrentContract_F__r.Contract_End_Date__c));

--
Gitblit v1.9.1