From 80b96f2bc9614b3d215a7a8b2bed08bbf7a2a51e Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期四, 14 四月 2022 18:06:13 +0800
Subject: [PATCH] 【委托】开通BJ-RS-ZB0063950的续签报价权限
---
force-app/main/default/classes/SelectAssetEstimateVMController.cls | 50 +++++++++++++++++++++++++++++---------------------
1 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/force-app/main/default/classes/SelectAssetEstimateVMController.cls b/force-app/main/default/classes/SelectAssetEstimateVMController.cls
index 3b9e7db..10bc607 100644
--- a/force-app/main/default/classes/SelectAssetEstimateVMController.cls
+++ b/force-app/main/default/classes/SelectAssetEstimateVMController.cls
@@ -237,12 +237,11 @@
}
}
//2021-11-30 fy add LJPH-C8W8FV 缃《 start OwnershipMachine_No__c Product2.ProductURF__c
- //tcm 娣诲姞 Management_Code__c 20211201 start
- //20220325 ljh LJPH-C8FB4P銆愬鎵樸�戦厤鍚圥BI璁惧瑕嗙洊鐜囩殑鏁版嵁鍑嗗 add CurrentContract_F__r.Is_Renewal__c
+ //tcm 娣诲姞 Management_Code__c 20211201 start
String soql = 'SELECT Id, Name,OwnershipMachine_No__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, '
+ 'Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, InstallDate,isNewDate_use__c, '
+ '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.Is_Renewal__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_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,'
+ 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,CurrentContract_F__r.Contract_Range__c,'
@@ -733,14 +732,16 @@
if (!String.isBlank(this.targetHospitalId) && (this.targetHospitalId.length() == 15 || this.targetHospitalId.length() == 18)) {
//2021-11-30 fy add LJPH-C8W8FV 缃《 start OwnershipMachine_No__c Product2.ProductURF__c
//tcm 娣诲姞 Management_Code__c 20211201 start
- //20220325 ljh LJPH-C8FB4P銆愬鎵樸�戦厤鍚圥BI璁惧瑕嗙洊鐜囩殑鏁版嵁鍑嗗 add CurrentContract_F__r.Is_Renewal__c
assetRecords = [SELECT Id, Name,OwnershipMachine_No__c,Product2.ProductURF__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c, Management_Code__c, IF_Warranty__c, Reson_Can_not_Warranty__c,
InstallDate, isNewDate_use__c, Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c, CurrentContract_End_Date__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.Is_Renewal__c, CurrentContract_F__r.Estimate_Num__c, CurrentContract_F__r.Contract_End_Date__c, CurrentContract_F__r.Estimate_Contract_endDate__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__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,
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
@@ -781,7 +782,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
];
@@ -849,6 +853,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,
@@ -1062,7 +1069,6 @@
}
checkedAssets=NumberSort;
//2021-11-30 fy add LJPH-C8W8FV 缃《 end
- System.debug('thh:' + checkedAssets);
}
//
@@ -1086,12 +1092,11 @@
notInId += '\')';
//2021-11-30 fy add LJPH-C8W8FV 缃《 start OwnershipMachine_No__c Product2.ProductURF__c
//tcm 娣诲姞 Management_Code__c 20211201 start
- //20220325 ljh LJPH-C8FB4P銆愬鎵樸�戦厤鍚圥BI璁惧瑕嗙洊鐜囩殑鏁版嵁鍑嗗 add CurrentContract_F__r.Is_Renewal__c
String sqlStr = 'SELECT Id, Name,OwnershipMachine_No__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, '
+ 'Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, InstallDate,isNewDate_use__c, '
+ 'Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c, '
+ '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.Is_Renewal__c, CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_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.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,'
@@ -1131,12 +1136,11 @@
String sqlStr = '';
//2021-11-30 fy add LJPH-C8W8FV 缃《 start OwnershipMachine_No__c Product2.ProductURF__c
//tcm 娣诲姞 Management_Code__c 20211201 start
- //20220325 ljh LJPH-C8FB4P銆愬鎵樸�戦厤鍚圥BI璁惧瑕嗙洊鐜囩殑鏁版嵁鍑嗗 add CurrentContract_F__r.Is_Renewal__c
sqlStr = 'SELECT Id, Name,OwnershipMachine_No__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c,';
sqlStr += 'Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c,InstallDate,isNewDate_use__c,';
sqlStr += 'Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c,';
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.Is_Renewal__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__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,';
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,';
@@ -2548,14 +2552,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
//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
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();
@@ -3039,8 +3045,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;
// 鍙紑濮嬫姤浠风殑鏈堟暟闄愬埗
@@ -3056,7 +3064,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);
@@ -3549,4 +3557,4 @@
// return returnValue;
// 2021-09-10 tcm 鎺掑簭閫昏緫璋冩暣 end
}
- }
\ No newline at end of file
+}
\ No newline at end of file
--
Gitblit v1.9.1