From 7ee2437b006cfc30e940cfb1711bf42f2ca3553d Mon Sep 17 00:00:00 2001 From: 涂煌豪 <tuhuanghao@prec-tech.com> Date: 星期二, 19 四月 2022 11:32:14 +0800 Subject: [PATCH] SelectAssetEstimateVMController修改 --- force-app/main/default/classes/SelectAssetEstimateVMController.cls | 43 ++++++++++++++++++++++++++++++++++--------- 1 files changed, 34 insertions(+), 9 deletions(-) diff --git a/force-app/main/default/classes/SelectAssetEstimateVMController.cls b/force-app/main/default/classes/SelectAssetEstimateVMController.cls index 49e425a..0f2b543 100644 --- a/force-app/main/default/classes/SelectAssetEstimateVMController.cls +++ b/force-app/main/default/classes/SelectAssetEstimateVMController.cls @@ -44,6 +44,7 @@ //HWAG-B399Q8 2018/08/20 妫�楠屾槸鍚︽樉绀�'璇锋彁浜ゅ緟瀹℃壒' start public Boolean IS_Clone_After_Decide { get; set; } //HWAG-B399Q8 2018/08/20 妫�楠屾槸鍚︽樉绀�'璇锋彁浜ゅ緟瀹℃壒' end + public List<String> TopProductModel =new List<String>(); static { recordNum = new List<SelectOption>(); recordNum.add(new SelectOption('10', '10')); @@ -239,8 +240,11 @@ + 'Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__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, ' - + 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,' + + '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,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\' '; @@ -589,7 +593,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 FROM Maintenance_Contract_Estimate__c WHERE Id = :this.targetEstimateId]; //HWAG-B399Q8 2018/08/20 娣诲姞涓�棰濆瀛楁 IS_Clone_After_Decide__c end decimal PriceSum = (this.estimate.Maintenance_Contract__r.Payment_Plan_Sum_First__c == null ? 0 : this.estimate.Maintenance_Contract__r.Payment_Plan_Sum_First__c) + @@ -704,6 +710,9 @@ CurrentContract_F__r.First_Estimate_Date__c, 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 + CurrentContract_F__r.Open_RenewalQuotation__c, + //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 end // 2021-01-29 LJPH-BX9CVX mzy add 鍚堝悓鎶ヤ环鏃跺垽鏂浂浠堕闄� NoPartRiskDate_F__c, NoPartRiskDate__c, SignableFlag__c, Product2.PartSupplyFinishDate__c, Product2.PartSupplyFinishDateExp__c @@ -744,7 +753,10 @@ Asset__r.CurrentContract_F__r.Estimate_Contract_endDate__c, 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 + Asset__r.CurrentContract_F__r.Gurantee_Estimate_startDate__c, + //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 start + Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c + //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 end from Maintenance_Contract_Asset__c where Maintenance_Contract__c = :this.targetMaintenanceContractId ]; @@ -809,6 +821,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, + //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 start + Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c, + //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220414 end LastMContract_Price__c, Asset__r.CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c, Asset__r.CurrentContract_F_asset__r.endDateGurantee_Text__c, @@ -1021,6 +1036,9 @@ + '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,' + '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 + '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 @@ -1065,6 +1083,9 @@ 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,'; sqlStr += 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,'; sqlStr += '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\' ) '; @@ -2405,14 +2426,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; - //add wangweipeng 2021/12/26 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; } - //add wangweipeng 2021/12/26 end + // add wangweipeng 2021/12/26 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(); @@ -2896,8 +2919,10 @@ //1.鍚堝悓鏈熶笉婊′竴骞存椂锛屽悎鍚屾湡瓒呰繃涓�鍗婃墠鍙紑濮嬬画绛炬姤浠枫��(eg:11涓湀鐨勫悎鍚屼粠6涓湀鍚庢墠鍙姤浠枫��) //2.涓�骞翠互涓婄殑鍚堝悓锛屽湪缁撴潫鍓�6涓湀寮�濮嬪彲浠ュ紑鏀剧画绛炬姤浠枫�� //3.绠$悊鍛樿烦杩囷紝 - if (UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c != 'VM_Contract') { - + //WLIG-CDFBV3 寮�閫氱画绛炬姤浠蜂负true鐨勫彲浠ュ紑鏀剧画绛炬姤浠� thh 20220413 + if (input.rec.CurrentContract_F__r.Open_RenewalQuotation__c == false && 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__r.Contract_End_Date__c); Decimal monthCon = (Decimal)noOfDays / 365 * 12; // 鍙紑濮嬫姤浠风殑鏈堟暟闄愬埗 @@ -2913,7 +2938,7 @@ } } // 澶氬勾淇濆垽鏂� - if ( String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') { + 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); @@ -3391,4 +3416,4 @@ // return returnValue; // 2021-09-10 tcm 鎺掑簭閫昏緫璋冩暣 end } - } \ No newline at end of file +} \ No newline at end of file -- Gitblit v1.9.1