| | |
| | | // chenjingwu 3+2多年保修 20240226 start |
| | | MultiYearWarranty__c mu = new MultiYearWarranty__c(); |
| | | System.debug('chen=>' + mpdDetails); |
| | | if(mpdDetails.MultiYearWarranty__c != '' && mpdDetails.MultiYearWarranty__c != null){ |
| | | if(String.isNotBlank(mpdDetails.MultiYearWarranty__c)){ |
| | | muIdList.add(mpdDetails.MultiYearWarranty__c); |
| | | } |
| | | // chenjingwu 3+2多年保修 20240226 end |
| | |
| | | mu.AmountWithheld__c = mpdDetails.AmountWithheld__c; |
| | | mu.ProductName__c = mpdDetails.ProductsID__c; |
| | | muUPdate.add(mu); |
| | | }else{ |
| | | //跟新标识 |
| | | product2.IsFromSAP__c = true; |
| | | product2Update.add(product2); |
| | | } |
| | | // chenjingwu 3+2多年保修 20240226 end |
| | | //跟新标识 |
| | | product2.IsFromSAP__c = true; |
| | | product2Update.add(product2); |
| | | } |
| | | // chenjingwu 3+2多年保修 20240226 start |
| | | if(muUPdate.size()>0 && muUPdate !=null ){ |
| | | if(muIdList.size()>0 && muIdList !=null ){ |
| | | List<MultiYearWarranty__c> muList = [select Id from MultiYearWarranty__c where ProductName__c in:muIdList]; |
| | | List<MultiYearWarranty__c> muList = [select Id from MultiYearWarranty__c where Id in:muIdList]; |
| | | delete muList; |
| | | } |
| | | Database.SaveResult[] lsr = Database.insert(muUPdate, false); |