From e2614ccbb5e53f8a3d41154a4d2d39748e78985c Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期四, 11 四月 2024 17:04:03 +0800
Subject: [PATCH] 123
---
force-app/main/default/classes/lexNewQuoteEntryController.cls | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/force-app/main/default/classes/lexNewQuoteEntryController.cls b/force-app/main/default/classes/lexNewQuoteEntryController.cls
index c7dc449..8d05dec 100644
--- a/force-app/main/default/classes/lexNewQuoteEntryController.cls
+++ b/force-app/main/default/classes/lexNewQuoteEntryController.cls
@@ -231,12 +231,14 @@
// }
@AuraEnabled
- public static Map<String,List<OptionTemplete>> addOptions(List<String> idList){
+ public static Map<String,Object> addOptions(List<String> idList){
Map<String,Integer> intList = new Map<String,Integer>();
for(AggregateResult objAgr: [select ProductName__c,COUNT(Id) total from MultiYearWarranty__c where ProductName__c in:idList group by ProductName__c]){
intList.put((String)objAgr.get('ProductName__c'), (Integer)objAgr.get('total'));
}
Map<String,List<OptionTemplete>> optionMap = new Map<String,List<OptionTemplete>>();
+ Map<String,Object> allMap = new Map<String,Object>();
+ Map<String,List<MultiYearWarranty__c>> priceMap = new Map<String,List<MultiYearWarranty__c>>();
for(String id: idList){
List<OptionTemplete> optionTempleteList = new List<OptionTemplete>();
optionTempleteList.add(new OptionTemplete('0骞�',''));
@@ -249,7 +251,19 @@
optionMap.put(id,optionTempleteList);
}
}
- return optionMap;
+ allMap.put('optionMap',optionMap);
+ List<MultiYearWarranty__c> muList = [select Id,ProductName__c,MultiOneYearWarrantyPrice__c,AmountWithheld__c,AgeLimit__c from MultiYearWarranty__c where ProductName__c in:idList];
+ for(String id: idList){
+ List<MultiYearWarranty__c> muList1 = new List<MultiYearWarranty__c>();
+ for(MultiYearWarranty__c mu : muList){
+ if(mu.ProductName__c == id){
+ muList1.add(mu);
+ }
+ }
+ priceMap.put(id,muList1);
+ }
+ allMap.put('priceMap',priceMap);
+ return allMap;
}
// chenjingwu 20240409 end
// DB202311242191 銆愭姤浠峰崟銆戞姤浠峰崟鍚堝悓閲戦鏇存柊鍜岀敓鎴愭柊鎶ヤ环鍗曡鍒欑‘璁ゅ拰淇敼 fy start
@@ -1614,6 +1628,9 @@
//chenjingwu DB202308355043 2023.8.25 start
,Category5__c
//chenjingwu DB202308355043 2023.8.25 end
+ //chenjingwu 20240411 start
+ ,ProductCategory__c
+ //chenjingwu 20240411 end
,Estimated_ConsumptionDueDate__c
//DB202312560765 you 鍚︽湁EndoRapid璧勮川妫�鏌� start
,IFEndoRapidFlag__c
@@ -1674,6 +1691,10 @@
//chenjingwu DB202308355043 2023.8.25 start
, prd.Category5__c
//chenjingwu DB202308355043 2023.8.25 end
+ //chenjingwu 20240411 start
+ , 0
+ ,prd.ProductCategory__c
+ //chenjingwu 20240411 end
//fy DB202312538864 2024.02.02 start
,prd.LastbuyProductFLG__c
,prd.whetherOldCode_PrePro__c
@@ -1703,6 +1724,10 @@
//chenjingwu DB202308355043 2023.8.25 start
, prd.Category5__c
//chenjingwu DB202308355043 2023.8.25 end
+ //chenjingwu 20240411 start
+ , 0
+ ,prd.ProductCategory__c
+ //chenjingwu 20240411 end
//fy DB202312538864 2024.02.02 start
,prd.LastbuyProductFLG__c
,prd.whetherOldCode_PrePro__c
@@ -1781,7 +1806,7 @@
for (String s : xlslist) {
//odd number or even number
// chenjingwu 20240411 start
- if (math.mod(i, 3) == 0) {
+ if (math.mod(i, 3) == 1) {
system.debug('xlslist1+++'+s);
//odd number
if (s == '' || s == null) {
@@ -1795,7 +1820,7 @@
xlsQuantity = Integer.valueOf(s);
Quantitylist.add(xlsQuantity);
}
- } else if(math.mod(i, 3) == 1){
+ } else if(math.mod(i, 3) == 0){
system.debug('xlslist2+++'+s);
//even number
if (s == '' || s == null) {
@@ -1886,6 +1911,9 @@
//chenjingwu DB202308355043 2023.8.25 start
,Category5__c
//chenjingwu DB202308355043 2023.8.25 end
+ //chenjingwu 20240411 start
+ ,ProductCategory__c
+ //chenjingwu 20240411 end
,Estimated_ConsumptionDueDate__c
//DB202312560765 you 鍚︽湁EndoRapid璧勮川妫�鏌� start
,IFEndoRapidFlag__c
@@ -1931,6 +1959,7 @@
//chenjingwu DB202308355043 2023.8.25 end
//chenjingwu 20240411 start
, exYearList[l]
+ ,prd.ProductCategory__c
//chenjingwu 20240411 end
//fy DB202312538864 2024.02.02 start
,prd.LastbuyProductFLG__c
@@ -1960,6 +1989,7 @@
//chenjingwu DB202308355043 2023.8.25 end
//chenjingwu 20240411 start
, exYearList[l]
+ , prd.ProductCategory__c
//chenjingwu 20240411 end
//fy DB202312538864 2024.02.02 start
,prd.LastbuyProductFLG__c
@@ -2890,9 +2920,11 @@
// chenjingwu sp涓绘満绫诲瀷 20240318 start
public String SPAssistant;
public Boolean SPAssistantFlag;
+ public String ProductCategory;
// chenjingwu sp涓绘満绫诲瀷 20240318 end
// chenjingwu 3+2澶氬勾淇� 20240401 start
public String Learning_Community;
+ public Decimal exPrice;
// public List<Map<String, String>> Learning_CommunityOptions = new List<Map<String, String>>();
public List<OptionTemplete> Learning_CommunityOptions;
public List<MultiYearWarranty__c> multiYearWarrantyList;
@@ -2915,6 +2947,7 @@
Category5 = qli.PricebookEntry.Product2.Category5__c;
//chenjingwu DB202308355043 2023.8.25 end
// chenjingwu SP涓绘満绫诲瀷 20240318 start
+ this.ProductCategory = qli.PricebookEntry.Product2.ProductCategory__c;
if(qli.PricebookEntry.Product2.ProductCategory__c == 'SP涓绘満'){
this.SPAssistantFlag = true;
}
@@ -2923,8 +2956,15 @@
if(qli.ExtendedWarrantyPeriod__c != null && qli.ExtendedWarrantyPeriod__c != 0){
this.Learning_Community = String.valueof(qli.ExtendedWarrantyPeriod__c);
}
- this.multiYearWarrantyList = [select Id,MultiOneYearWarrantyPrice__c,AmountWithheld__c from MultiYearWarranty__c where ProductName__c =: qli.PricebookEntry.Product2Id];
+ this.multiYearWarrantyList = [select Id,MultiOneYearWarrantyPrice__c,AmountWithheld__c,AgeLimit__c from MultiYearWarranty__c where ProductName__c =: qli.PricebookEntry.Product2Id];
Integer period = this.multiYearWarrantyList.size();
+ if(qli.ExtendedWarrantyPeriod__c != null && qli.ExtendedWarrantyPeriod__c != 0){
+ for(MultiYearWarranty__c mu: this.multiYearWarrantyList){
+ if(mu.AgeLimit__c == qli.ExtendedWarrantyPeriod__c){
+ this.exPrice = mu.MultiOneYearWarrantyPrice__c;
+ }
+ }
+ }
if(period > 0){
List<OptionTemplete> optionTempleteList = new List<OptionTemplete>();
optionTempleteList.add(new OptionTemplete('0骞�',''));
@@ -3162,6 +3202,7 @@
//chenjingwu DB202308355043 2023.8.25 end
//chenjingwu 20240411 start
, Integer exYear
+ ,String ProductCategory
//chenjingwu 20240411 end
//fy DB202312538864 2024.02.02 start
,Boolean lastbuyProductFLG
@@ -3174,7 +3215,8 @@
pageObject = New QuoteLineItem();
pageObject.Quantity__c = Quantity;
//chenjingwu 20240411 start
- pageObject.ExtendedWarrantyPeriod__c = exYear;
+ this.Learning_Community = String.valueof(exYear);
+ this.ProductCategory = ProductCategory;
//chenjingwu 20240411 end
this.lineNo = i;
this.Asset_Model = Asset_Model;
--
Gitblit v1.9.1