| | |
| | | } |
| | | if (accountIdList != null && accountIdList.size() > 0) { |
| | | query = 'select id,Hospital__c,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Conclusion_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset where ' |
| | | +' IF_Parts_production__c != \'1\' and CurrentContract__c != null and Hospital__c in :accountIdList' |
| | | +' IF_StopParts_production__c != \'1\' and CurrentContract__c != null and Hospital__c in :accountIdList' |
| | | +' and (CurrentContract__r.Contract_End_Date__c >= :start_dateH1 and CurrentContract__r.Contract_Conclusion_Date__c <= :end_dateH1) order by hospital__c'; |
| | | }else{ |
| | | query = 'select id,Hospital__c,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Conclusion_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset where ' |
| | | +' IF_Parts_production__c != \'1\' and CurrentContract__c != null' |
| | | +' IF_StopParts_production__c != \'1\' and CurrentContract__c != null' |
| | | +' and (CurrentContract__r.Contract_End_Date__c >= :start_dateH1 and CurrentContract__r.Contract_Conclusion_Date__c <= :end_dateH1) order by hospital__c'; |
| | | } |
| | | |
| | |
| | | end_dateH1 = Date.newInstance(toDayTime.year(),9,30); |
| | | }else{ |
| | | start_dateH1 = Date.newInstance(toDayTime.year(),3,1); |
| | | end_dateH1 = Date.newInstance(toDayTime.year()+1,3,31); |
| | | end_dateH1 = Date.newInstance(toDayTime.year(),3,31); |
| | | } |
| | | return Database.getQueryLocator(query); |
| | | } |
| | |
| | | for (Asset ass : Assets) { |
| | | accIds.add(ass.Hospital__c); |
| | | } |
| | | List<Account_Service_Of_Target__c> asotList = [select Id,Finish_Rigid_Mirror_2__c,Finish_Rigid_Mirror_3__c,Finish_Correlation_Lightsource__c,Finish_Rigid_Mirror_1__c,Account_HP__c,OCSM_Period_half__c |
| | | List<Account_Service_Of_Target__c> asotList = [select Id,Finish_Rigid_Mirror_2__c,Finish_Correlation_Lightsource__c,Finish_Rigid_Mirror_1__c,Account_HP__c,OCSM_Period_half__c |
| | | from Account_Service_Of_Target__c |
| | | where Account_HP__c in :accIds and OCSM_Period_half__c = :OCSM_Period_half |
| | | and OCSM_Period__c = :OCSM_Period]; |
| | |
| | | system.debug('这个集合:AssetsReal ==='+AssetsReal); |
| | | if (AssetsReal!=null) { |
| | | try { |
| | | Oly_TriggerHandler.bypass('AssetTrigger'); |
| | | update AssetsReal; |
| | | } |
| | | catch (Exception e) { |