黄千龙
2022-04-08 fe7d1b90f57b14ca09852c0e80f58a412b50478d
force-app/main/default/classes/EquipmentRenewMoleculeBatch.cls
@@ -36,12 +36,12 @@
        if (accountIdList != null && accountIdList.size() > 0) {
            // 保有设备不为零件停产
        query = 'select Id,Hospital__c,CurrentContract__c,CurrentContract__r.Contract_Conclusion_Date__c,CurrentContract__r.New_Contract_TypeF_Text__c,Product2.ServiceCategory__c,Product2.Category3__c,Product2.Category4__c'
                +' from Asset where Hospital__c in :accountIdList and IF_Parts_production__c != \'1\' and CurrentContract__r.New_Contract_TypeF_Text__c =\'续签合同\''
                +' from Asset where Hospital__c in :accountIdList and IF_StopParts_production__c != \'1\' and CurrentContract__r.New_Contract_TypeF_Text__c =\'续签合同\''
                +' and CurrentContract__r.Contract_Conclusion_Date__c <= :effectiveTime order by hospital__c';
        }else{
            // 保有设备不为零件停产
        query = 'select Id,Hospital__c,CurrentContract__c,CurrentContract__r.Contract_Conclusion_Date__c,CurrentContract__r.New_Contract_TypeF_Text__c,Product2.ServiceCategory__c,Product2.Category3__c,Product2.Category4__c'
                +' from Asset where IF_Parts_production__c != \'1\' and CurrentContract__r.New_Contract_TypeF_Text__c =\'续签合同\''
                +' from Asset where IF_StopParts_production__c != \'1\' and CurrentContract__r.New_Contract_TypeF_Text__c =\'续签合同\''
                +' and CurrentContract__r.Contract_Conclusion_Date__c <= :effectiveTime order by hospital__c';
        }
        return Database.getQueryLocator(query);
@@ -55,7 +55,7 @@
        for (Asset ass1 : Assets) {
            accIds.add(ass1.Hospital__c);
        }
        List<Account_Service_Of_Target__c> asotList = [select Id,Renew_Finish_Rigid_Mirror_1__c,Renew_Finish_Rigid_Mirror_2__c,Renew_Finish_Rigid_Mirror_3__c,Renew_Finish_Correlation_Lightsource__c,Renew_Finish_Else__c,Account_HP__c,OCSM_Period_half__c
        List<Account_Service_Of_Target__c> asotList = [select Id,Renew_Finish_Rigid_Mirror_1__c,Renew_Finish_Rigid_Mirror_3__c,Renew_Finish_Correlation_Lightsource__c,Renew_Finish_Else__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];
@@ -129,6 +129,7 @@
            }   
        if (AssetsReal!=null) {
                    try {
                        Oly_TriggerHandler.bypass('AssetTrigger');
                        update AssetsReal;
                    }
                    catch (Exception e) {