From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新
---
force-app/main/default/classes/RollupToHPBatch.cls | 111 ++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 97 insertions(+), 14 deletions(-)
diff --git a/force-app/main/default/classes/RollupToHPBatch.cls b/force-app/main/default/classes/RollupToHPBatch.cls
index 504a438..ff6dd55 100644
--- a/force-app/main/default/classes/RollupToHPBatch.cls
+++ b/force-app/main/default/classes/RollupToHPBatch.cls
@@ -765,10 +765,20 @@
convertCurrency(RANK_D_inc_tax__c), convertCurrency(RANK_E_inc_tax__c),
Today_Rate__c, Trade__c, convertCurrency(Forecast_Amount_All_F__c), convertCurrency(ShippedAmount__c),
Opp_Actual_ThousandY__c, BO_Forecast_ThousandY__c,
- OP_ThousandY__c, Opp_Forecast_ThousandY__c,
- Opportunity_ThousandY__c, Amount_Without_Tax_Thousand_F__c,
+ // 20220722 ljh SWAG-CE6A58 update start
+ // OP_ThousandY__c, Opp_Forecast_ThousandY__c,
+ // Opportunity_ThousandY__c, Amount_Without_Tax_Thousand_F__c,
+ OP_ThousandY_Target__c, Opp_Forecast_ThousandY__c,
+ Opportunity_ThousandY_Target__c, Amount_Without_Tax_Thousand_F__c,
+ // 20220722 ljh SWAG-CE6A58 update end
Hospital__c, Department_Class__c
, OCSM_RMB_Without_Tax_1000TR__c//20220111 SWAG-C8MBB6 鍔�7.璇环 lt
+ //20230222 DB202302339407 you start
+ ,LostPrices__c
+ ,convertCurrency(Dealer_Final_Price__c)
+ ,order_Date_For_Report__c
+ ,StageName__c
+ //20230222 DB202302339407 you end
from Opportunity
where Hospital__c in :hpList
]) {
@@ -790,16 +800,37 @@
Decimal o1 = opp.Opp_Actual_ThousandY__c == null ? 0 : opp.Opp_Actual_ThousandY__c;
Decimal o2 = opp.BO_Forecast_ThousandY__c == null ? 0 : opp.BO_Forecast_ThousandY__c;
- Decimal o3 = opp.OP_ThousandY__c == null ? 0 : opp.OP_ThousandY__c;
+ // 20220722 ljh SWAG-CE6A58 update start
+ // Decimal o3 = opp.OP_ThousandY__c == null ? 0 : opp.OP_ThousandY__c;
+ Decimal o3 = opp.OP_ThousandY_Target__c == null ? 0 : opp.OP_ThousandY_Target__c;
+ // 20220722 ljh SWAG-CE6A58 update end
Decimal o4 = opp.Opp_Forecast_ThousandY__c == null ? 0 : opp.Opp_Forecast_ThousandY__c;
- Decimal o5 = opp.Opportunity_ThousandY__c == null ? 0 : opp.Opportunity_ThousandY__c;
+ // 20220722 ljh SWAG-CE6A58 update start
+ // Decimal o5 = opp.Opportunity_ThousandY__c == null ? 0 : opp.Opportunity_ThousandY__c;
+ Decimal o5 = opp.Opportunity_ThousandY_Target__c == null ? 0 : opp.Opportunity_ThousandY_Target__c;
+ // 20220722 ljh SWAG-CE6A58 update end
Decimal o6 = opp.Amount_Without_Tax_Thousand_F__c == null ? 0 : opp.Amount_Without_Tax_Thousand_F__c;
//20220111 SWAG-C8MBB6 鍔�7.璇环 lt start
Decimal o7 = opp.OCSM_RMB_Without_Tax_1000TR__c == null ? 0 : opp.OCSM_RMB_Without_Tax_1000TR__c;
//20220111 SWAG-C8MBB6 鍔�7.璇环 lt end
- setOppAmount(hpacc, o1, o2, o3, o4, o5, o6, o7);
- setOppAmount(dcacc, o1, o2, o3, o4, o5, o6, o7);
+ //20230222 you start
+ Decimal o8 = 0;
+ Decimal o9 = 0;
+ Decimal o10 = 0;
+
+ if(opp.order_Date_For_Report__c>= thisYd && opp.order_Date_For_Report__c < nextYd){
+ o8 = opp.LostPrices__c == null ? 0 : opp.LostPrices__c;
+ if(opp.StageName__c !='澶卞崟' && opp.StageName__c !='鍙栨秷'){
+ o9 = opp.Dealer_Final_Price__c == null ? 0 : opp.Dealer_Final_Price__c / 1.13 / 1000;
+ }
+ o10 = o8 + o9;
+ }
+ //20230222 you end
+ setOppAmount(hpacc, o1, o2, o3, o4, o5, o6, o7,o8,o9,o10);
+ setOppAmount(dcacc, o1, o2, o3, o4, o5, o6, o7,o8,o9,o10);
+
}
+
// 鎶ュ憡涔�
for (Report__c report : [
@@ -1338,6 +1369,10 @@
acc.Asset_Cnt_TB__c = 0;
acc.Asset_Cnt_USG400__c = 0;
//SWAG-BSC5WP you-20201021 end
+ //20220601 WLIG-CEWDWS you start
+ acc.Asset_Cnt_TB_0520__c = 0;
+ acc.Asset_Cnt_TB_0535__c = 0;
+ //20220601 WLIG-CEWDWS you end
//20200825 ljh SWAG-BRY6PF add start
for (Integer columnNameInt = targetmonth + intMonth; columnNameInt <= targetmonth; columnNameInt++) {
@@ -1370,7 +1405,6 @@
acc.Opp_Actual_ThousandY__c = 0;
acc.BO_Forecast_ThousandY__c = 0;
acc.OP_ThousandY__c = 0;
-
acc.Opp_Forecast_ThousandY__c = 0;
acc.Opportunity_ThousandY__c = 0;
acc.Amount_Without_Tax_Thousand__c = 0;
@@ -1378,6 +1412,12 @@
//20220111 SWAG-C8MBB6 鍔�7.璇环 lt start
acc.AllOP_ThousandY__c = 0;
//20220111 SWAG-C8MBB6 鍔�7.璇环 lt end
+
+ //20230222 you start
+ acc.LostPrices__c = 0;
+ acc.Dealer_Final_Price__c = 0;
+ acc.HospitalTransactionAmount__c = 0;
+ //20230222 you end
acc.Important_product1__c = 0;
acc.Important_product2__c = 0;
@@ -1566,7 +1606,11 @@
acc.Opp_cnt_OTVS300__c = 0;
acc.Opp_cnt_ESG400__c = 0;
acc.Opp_cnt_TB__c = 0;
-
+ //20220601 WLIG-CEWDWS you start
+ acc.Opp_cnt_TB_0520__c = 0;
+ acc.Opp_cnt_TB_0535__c = 0;
+ //20220601 WLIG-CEWDWS you end
+
acc.Delivery_cnt_290MiroBF__c = 0;
acc.Delivery_cnt_290MiroGI__c = 0;
acc.Delivery_cnt_290MiroGI_Plus__c = 0;
@@ -1575,6 +1619,10 @@
acc.Delivery_cnt_OTVS300__c = 0;
acc.Delivery_cnt_ESG400__c = 0;
acc.Delivery_cnt_TB__c = 0;
+ //20220601 WLIG-CEWDWS you start
+ acc.Delivery_cnt_TB_0520__c = 0;
+ acc.Delivery_cnt_TB_0535__c = 0;
+ //20220601 WLIG-CEWDWS you end
acc.Order_cnt_290MiroBF__c = 0;
acc.Order_cnt_290MiroGI__c = 0;
@@ -1584,6 +1632,10 @@
acc.Order_cnt_OTVS300__c = 0;
acc.Order_cnt_ESG400__c = 0;
acc.Order_cnt_TB__c = 0;
+ //20220601 WLIG-CEWDWS you start
+ acc.Order_cnt_TB_0520__c = 0;
+ acc.Order_cnt_TB_0535__c = 0;
+ //20220601 WLIG-CEWDWS you end
acc.OPD_USG400__c = 0;
acc.OPD_OTV_S400__c = 0;
@@ -1596,6 +1648,10 @@
acc.OPD_ESG400__c = 0;
acc.OPD_TB__c = 0;
// SWAG-BQ75WE 20200609 End
+ //20220601 WLIG-CEWDWS you start
+ acc.OPD_TB_0520__c = 0;
+ acc.OPD_TB_0535__c = 0;
+ //20220601 WLIG-CEWDWS you end
}
@@ -1759,7 +1815,7 @@
acc.ShippedAmount_HP__c += sa;
}
- private void setOppAmount(Account2__c acc, Decimal o1, Decimal o2, Decimal o3, Decimal o4, Decimal o5, Decimal o6, Decimal o7) {
+ private void setOppAmount(Account2__c acc, Decimal o1, Decimal o2, Decimal o3, Decimal o4, Decimal o5, Decimal o6, Decimal o7,Decimal o8,Decimal o9,Decimal o10) {
acc.Opp_Actual_ThousandY__c += o1;
acc.BO_Forecast_ThousandY__c += o2;
acc.OP_ThousandY__c += o3;
@@ -1769,6 +1825,12 @@
//20220111 SWAG-C8MBB6 鍔�7.璇环 lt start
acc.AllOP_ThousandY__c += o7;
//20220111 SWAG-C8MBB6 鍔�7.璇环 lt end
+ //20230222 you start
+ acc.LostPrices__c += o8;
+ acc.Dealer_Final_Price__c += o9;
+ acc.HospitalTransactionAmount__c += o10;
+
+ //20230222 you end
}
private void setOpdIproductCount(Account2__c acc, Decimal decIP1, Decimal decIP2, Decimal decIP3, Decimal decIP4, Decimal decIP5, Decimal decIP6, Decimal decIP7, Decimal decIP8, Decimal decIP9, Decimal decIP10,
@@ -2047,7 +2109,11 @@
when '18' {acc.Asset_Cnt_OTVS190__c += tmpCnt;}
when '28' {acc.Asset_Cnt_ESG400__c += tmpCnt;}
when '29' {acc.Asset_Cnt_USG400__c += tmpCnt;}
- when '30' {acc.Asset_Cnt_TB__c += tmpCnt;}
+ //20220601 WLIG-CEWDWS you start
+ //when '30' {acc.Asset_Cnt_TB__c += tmpCnt;}
+ when '20' {acc.Asset_Cnt_TB_0535__c += tmpCnt;}
+ when '21' {acc.Asset_Cnt_TB_0520__c += tmpCnt;}
+ //20220601 WLIG-CEWDWS you end
when else {
system.debug('=====setAssetCount else:' + tmpKey + '_x_' + tmpCnt);
}
@@ -2152,14 +2218,21 @@
filedNameMap.put('9', '290Miro_BF__c');
filedNameMap.put('14', 'OTV_S400__c');
filedNameMap.put('15', 'OTV_S300__c');
+
filedNameMap.put('16', 'CV_170__c');
filedNameMap.put('17', 'CV_190__c');
+
// 20210602 SWAG-C3K6L7 Start
//filedNameMap.put('18', 'OTV_S190__c');
// 20210602 SWAG-C3K6L7 End
filedNameMap.put('28', 'ESG400__c');
- filedNameMap.put('29', 'USG400__c');
- filedNameMap.put('30', 'TB__c');
+ filedNameMap.put('29', 'USG400__c'); //璁板綍you 涓婅储骞存病鏈�29 锛屽彧涓嶈繃娌℃湁娉ㄩ噴锛屼粖骞存湁锛屾墍浠ヤ笉鐢ㄥ姩
+ //20220601 WLIG-CEWDWS you start
+ //filedNameMap.put('30', 'TB__c');
+ filedNameMap.put('20', 'TB_0535__c');
+ filedNameMap.put('21', 'TB_0520__c');
+ //20220601 WLIG-CEWDWS you end
+
} else {
filedNameMap = new Map<String,String>();
filedNameMap.put('1', 'CV290__c');
@@ -2173,14 +2246,20 @@
filedNameMap.put('9', '290MiroBF__c');
filedNameMap.put('14', 'OTVS400__c');
filedNameMap.put('15', 'OTVS300__c');
+
filedNameMap.put('16', 'CV170__c');
filedNameMap.put('17', 'CV190__c');
+
// 20210602 SWAG-C3K6L7 Start
//filedNameMap.put('18', 'OTVS190__c');
// 20210602 SWAG-C3K6L7 End
filedNameMap.put('28', 'ESG400__c');
filedNameMap.put('29', 'USG400__c');
- filedNameMap.put('30', 'TB__c');
+ //20220601 WLIG-CEWDWS you start
+ //filedNameMap.put('30', 'TB__c');
+ filedNameMap.put('20', 'TB_0535__c');
+ filedNameMap.put('21', 'TB_0520__c');
+ //20220601 WLIG-CEWDWS you end
// }
}
@@ -2258,8 +2337,11 @@
allList.add(onlyCountDepList);
// 20210602 SWAG-C3K6L7 Start
//}else if(i == '14' || i == '15' || i == '17' || i == '18' || i == '29' || i == '28' || i == '30'){
- } else if(i == '14' || i == '15' || i == '17' || i == '29' || i == '28' || i == '30'){
+ //} else if(i == '14' || i == '15' || i == '17' || i == '29' || i == '28' || i == '30'){
// 20210602 SWAG-C3K6L7 End
+ //20220601 WLIG-CEWDWS you start
+ } else if(i == '14' || i == '15' || i == '17' || i == '29' || i == '28' || i == '20' || i == '21'){
+ //20220601 WLIG-CEWDWS you end
// 杩欓噷鏄渶瑕佷慨鏀圭殑 start
allCountDepList.add(departmentGS); // 閮借绠楀湪鏅绉戦噷
// noCountDepList.add() 杩欓噷娌℃湁涓嶉渶瑕佽绠楃殑绉戝
@@ -2314,4 +2396,5 @@
countImportantProduct(acc,nameType,tmpCnt,tmpKey,allList,departmentE,depToOtherDepAcc2Map, updateAccount, OldAccount2);
}
+
}
\ No newline at end of file
--
Gitblit v1.9.1