付煜
2022-03-31 63c2873a64e260d65aa5e6501552698f47a6c6b0
Merge branch '【委托】【重要-询价】询价等级和询价金额计算点问题'
1个文件已修改
85 ■■■■■ 已修改文件
force-app/main/default/classes/NFM007Controller.cls 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NFM007Controller.cls
@@ -169,7 +169,10 @@
                                                // LHJ 多年保修 20190627 Start
                                                Gurantee_Period__c,DecideQuoteDate__c,
                                                // LHJ 多年保修 20190627 End
                                                STMS_Package_Sale__c, Equipment_Order_Flg__c
                                                STMS_Package_Sale__c, Equipment_Order_Flg__c,
                                                //【是否需要价格申请】为是的场合,才要检查做没做过报价试算 thh 2021-11-03 start
                                                If_Need_PriceApply__c
                                                //【是否需要价格申请】为是的场合,才要检查做没做过报价试算 thh 2021-11-03 end
                                           from Opportunity where Id IN :oppIds];
            System.debug(Logginglevel.DEBUG, 'NFM007_ oppList.size()=' + oppList.size());
@@ -323,7 +326,8 @@
                quotation.Detail = new List<Detail_element>();
                //CHAN-BDPBVY 20190703 end
                // 20211101 gzw 报价试算  fix  试算行项目有值,发试算信息,否则发询价行项目 end
                if (promotionSalesProductsList != null && promotionSalesProductsList.size() > 0) {
                //询价上的【是否需要价格申请】为是的场合,才要检查做没做过报价试算 thh 2021-11-03
                if (opp.If_Need_PriceApply__c && promotionSalesProductsList != null && promotionSalesProductsList.size() > 0) {
                    for(Integer i = 0; i < promotionSalesProductsList.size(); i++){
                        Detail_element detail = new Detail_element();
                        quotation.Detail.add(detail);
@@ -366,7 +370,21 @@
                            detail.PROCODE = '8888';
                        }
                        system.debug(' detail.PROCODE=='+detail.PROCODE);
                        detail.GuaranteeType = promotionSalesProductsList.get(i).latestWarrantyType__c;  // 保修类别
                        //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy start
                        if(opp.Trade__c == '外貿'){
                            detail.GuaranteeType = promotionSalesProductsList.get(i).latestWarrantyType__c+',';// 保修类别
                        }else{
                            Date nowDate = Date.today();
                            // Date baojidate = Date.valueOf('2022-4-1');
                            Date baojidate = Date.newInstance(2022,3,30);
                            if(baojidate<=nowDate){
                                detail.GuaranteeType = promotionSalesProductsList.get(i).latestWarrantyType__c+',new';
                            }else{
                                detail.GuaranteeType = promotionSalesProductsList.get(i).latestWarrantyType__c+',';
                            }
                        }
                        //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy end
                        // detail.GuaranteeType = promotionSalesProductsList.get(i).latestWarrantyType__c;  // 保修类别
                        if (!oldDate) {
                            if (promotionSalesProductsList.get(i).latestProvistonPeriod__c != null) {
                                detail.ProvistonPeriod = String.valueOf(promotionSalesProductsList.get(i).latestProvistonPeriod__c).leftPad(2,'0');
@@ -468,9 +486,36 @@
                            
                            //保修类别
                            if(oppLiList.get(i).latestWarrantyType__c != null){
                                detail.GuaranteeType = oppLiList.get(i).latestWarrantyType__c;  // 保修类别
                                //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy start
                                if(opp.Trade__c == '外貿'){
                                    detail.GuaranteeType = oppLiList.get(i).latestWarrantyType__c+',';// 保修类别
                                }else{
                                    Date nowDate = Date.today();
                                    // Date baojidate = Date.valueOf('2022-4-1');
                                    Date baojidate = Date.newInstance(2022,3,30);
                                    if(baojidate<=nowDate){
                                        detail.GuaranteeType = oppLiList.get(i).latestWarrantyType__c+',new';
                                    }else{
                                        detail.GuaranteeType = oppLiList.get(i).latestWarrantyType__c+',';
                                    }
                                }
                                //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy end
                                // detail.GuaranteeType = oppLiList.get(i).latestWarrantyType__c;  // 保修类别
                            }else{
                                detail.GuaranteeType = null;
                                //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy start
                                if(opp.Trade__c == '外貿'){
                                    detail.GuaranteeType = ',';
                                }else{
                                    Date nowDate = Date.today();
                                    Date baojidate = Date.newInstance(2022,3,30);
                                    if(baojidate<=nowDate){
                                        detail.GuaranteeType = ',new';
                                    }else{
                                        detail.GuaranteeType = ',';
                                    }
                                }
                                //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy end
                                // detail.GuaranteeType = null;
                            }
                            //计提金额
                            detail.GuaranteePrice = oppLiList.get(i).latestGuranteePrice__c;
@@ -488,7 +533,20 @@
                            // detail.GuaranteePeriod = null;
                            // detail.GuaranteeType = null;
                            //外贸多年保修未上线前 保修类别 传null
                            detail.GuaranteeType = null;
                            //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy start
                            if(opp.Trade__c == '外貿'){
                                detail.GuaranteeType = ',';
                            }else{
                                Date nowDate = Date.today();
                                Date baojidate = Date.newInstance(2022,3,30);
                                if(baojidate<=nowDate){
                                    detail.GuaranteeType = ',new';
                                }else{
                                    detail.GuaranteeType = ',';
                                }
                            }
                            //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy end
                            // detail.GuaranteeType = null;
                            //外贸多年保修未上线前  计提金额 传0 
                            detail.GuaranteePrice = 0;
                            //外贸多年保修未上线前 nodiscount 传0
@@ -502,7 +560,20 @@
                        //③decide在20191001 之前  老数据
                        else if(oldDate){
                            detail.GuaranteePeriod = null;
                            detail.GuaranteeType = null;
                            //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy start
                            if(opp.Trade__c == '外貿'){
                                detail.GuaranteeType = ',';
                            }else{
                                Date nowDate = Date.today();
                                Date baojidate = Date.newInstance(2022,3,30);
                                if(baojidate<=nowDate){
                                    detail.GuaranteeType = ',new';
                                }else{
                                    detail.GuaranteeType = ',';
                                }
                            }
                            //WLIG-CCT9UG 【委托】关于市场多年保计提金调整 fy end
                            // detail.GuaranteeType = null;
                            detail.ProvistonPeriod = null;
                            detail.GuaranteePrice = null;
                            detail.ServicePrice = null;