| | |
| | | // PK 2021/12/6 start |
| | | public String AdvancePaymentFlag; |
| | | // PK 2021/12/6 end |
| | | //DB202211397391“维保预判”和“维保项目”新增方案 fy start |
| | | public String MAFINAL; |
| | | //DB202211397391“维保预判”和“维保项目”新增方案 fy end |
| | | } |
| | | global class DiscountInformation { |
| | | public String DiscountType; |
| | |
| | | } |
| | | |
| | | //修理を検索 |
| | | List<Repair__c> sfdcRpairList = [select Id, Name, SAPRepairNo__c, Repair_Quotation_Id__c |
| | | //DB202211397391“维保预判”和“维保项目”新增方案 fy start MAFINAL__c |
| | | List<Repair__c> sfdcRpairList = [select Id, Name, SAPRepairNo__c, Repair_Quotation_Id__c,MAFINAL__c |
| | | , Repair_Quotation_Id__r.MessageGroupNumber__c |
| | | from Repair__c |
| | | where Name in :receiptNoList]; |
| | |
| | | repairUpdateMap.put(quoteInfo.SAPQuotationNo, rpr); |
| | | rpr.SAPRepairNo__c = quoteInfo.SAPRepairNo; |
| | | rpr.Repair_Rank__c = quoteInfo.RepairRank; |
| | | //DB202211397391“维保预判”和“维保项目”新增方案 fy start |
| | | rpr.MAFINAL__c = 'X'.equals(quoteInfo.MAFINAL) ? '维护保养项目(SAP)':''; |
| | | system.debug('quoteInfo.MAFINAL++'+quoteInfo.MAFINAL); |
| | | // if('X'.equals(quoteInfo.MAFINAL)){ |
| | | // rpr.MAFINAL__c ='维护保养项目(SAP)'; |
| | | // }else{ |
| | | // rpr.MAFINAL__c =''; |
| | | // } |
| | | //DB202211397391“维保预判”和“维保项目”新增方案 fy end |
| | | /*if (String.isBlank(quoteInfo.CafeteriaFlag) == false && ( quoteInfo.CafeteriaFlag.length() == 15 || quoteInfo.CafeteriaFlag.length() == 18)) { |
| | | rpr.Dealer__c = quoteInfo.CafeteriaFlag; |
| | | }*/ |
| | |
| | | else if (di.DiscountType == 'CCD线短') { |
| | | rq.CCD_cut__c = String.isBlank(di.DiscountAmount) ? null : Decimal.valueOf(di.DiscountAmount); |
| | | } |
| | | // 打折理由增加:召回对应(服务管理) |
| | | else if (di.DiscountType == '召回对应') { |
| | | rq.callback_corresponding__c = String.isBlank(di.DiscountAmount) ? null : Decimal.valueOf(di.DiscountAmount); |
| | | } |
| | | else if (di.DiscountType == '特别对应') { |
| | | rq.Special_offer__c = String.isBlank(di.DiscountAmount) ? null : Decimal.valueOf(di.DiscountAmount); |
| | | } |
| | |
| | | // add by hanchao 2016.7.21 |
| | | else if (di.DiscountType == '运输索赔') { |
| | | rq.Delivery_compensation__c = String.isBlank(di.DiscountAmount) ? null : Decimal.valueOf(di.DiscountAmount); |
| | | } |
| | | //DB202303075842 LY 2023/3/6 add |
| | | else if (di.DiscountType == '上限合同'){ |
| | | rq.LimitPrice_contract_discount_amount__c = String.isBlank(di.DiscountAmount) ? null : Decimal.valueOf(di.DiscountAmount); |
| | | } |
| | | // |
| | | else if (di.DiscountType == '其他') { |
| | |
| | | upsert rqList; |
| | | deleteInsertReasons(rqUpdateMap, quotationReasonsMap, null); // repairReasonsMap |
| | | } |
| | | |
| | | if (repairUpdateMap.size() > 0) { |
| | | //同期中的报价をwrite back, Idについて見積りがupsert後しかとれないです。 |
| | | for (String sapQuotationNo : repairUpdateMap.keySet()) { |
| | |
| | | rpr.Repair_Quotation_Id__c = rqUpdateMap.get(sapQuotationNo).Id; |
| | | rpr.Repair_Estimated_Date__c = rqUpdateMap.get(sapQuotationNo).FirstQuotationDate__c; |
| | | rpr.Repair_Discount_Date__c = rqUpdateMap.get(sapQuotationNo).Repair_Discount_Date__c; |
| | | |
| | | } |
| | | update repairUpdateMap.values(); |
| | | } |
| | |
| | | } |
| | | List<Repair_Quotation_reason__c> qrsnList = new List<Repair_Quotation_reason__c>(); |
| | | List<Repair_reason__c> rrsnList = new List<Repair_reason__c>(); |
| | | Map<String ,Repair__c> repMap = new Map<String ,Repair__c>(); // 2023-01-06 zyh add |
| | | for (String rqName : quotationReasonsMap.keySet()) { |
| | | List<Repair_Quotation_reason__c> quotationReasons = quotationReasonsMap.get(rqName); |
| | | qrsnList.addAll(quotationReasons); |
| | |
| | | rrsnList.addAll(repairReasons); |
| | | for (Repair_reason__c rrsn : repairReasons) { |
| | | rrsn.Repair_quotation__c = rqNameMap.get(rqName).Id; |
| | | // 2022-01-06 zyh add start |
| | | Repair__c repTemp = new Repair__c(); |
| | | repTemp.Id = rrsn.Repair__c; |
| | | repTemp.RepairReasonTrigger__c = Datetime.now(); |
| | | repMap.put(repTemp.Id, repTemp); |
| | | // 2022-01-06 zyh add end |
| | | } |
| | | } |
| | | } |
| | | System.debug('deleteInsertReasons qrsnList=' + qrsnList); |
| | | if (rrsnList.size() > 0) insert rrsnList; |
| | | // 2022-01-06 zyh add start |
| | | if (repMap.size() > 0) update repMap.values(); |
| | | // 2022-01-06 zyh add end |
| | | if (qrsnList.size() > 0) insert qrsnList; |
| | | } |
| | | |