/*lexSelectAssetEstimateVMController 方法权限*/ public without sharing class lexSelectAssetEstimateUtil { public static void NextMaintenanceContract(List checkedAssets,Maintenance_Contract__c contract) { // 20220810 询价2期开发 List asslocalList = new List(); List mcalocalList = new List(); Map map3 = new Map(); List mcaupdateList = new List(); for (lexSelectAssetEstimateVMController.AssetInfo ass : checkedAssets) { if (!ass.isManual) { asslocalList.add(ass.rec.Id); map3.put(ass.rec.Id,contract); } } List mcalist1 = [SELECT id,Asset__c,Next_Maintenance_Contract__c,Maintenance_Contract__c FROM Maintenance_Contract_Asset__c WHERE id IN (SELECT CurrentContract_F_asset__c FROM asset WHERE id IN :asslocalList AND CurrentContract_F_asset__c!=null)]; for (Maintenance_Contract_Asset__c mca : mcalist1) { Maintenance_Contract_Asset__c mca3 = new Maintenance_Contract_Asset__c(); if (map3.containsKey(mca.Asset__c)) { mca3.id = mca.id; mca3.Next_Maintenance_Contract__c = map3.get(mca.Asset__c).id; if (mca3.id!=null&&!mcaupdateList.contains(mca3)) { mcaupdateList.add(mca3); } } } System.debug('mcaupdateList====%%%' +mcaupdateList); if (mcaupdateList!=null&&!mcaupdateList.isEmpty()) { update mcaupdateList; } } }