李彤
2022-11-16 3d8a1f5c0952d3d62b8c24432f8525871c32e591
DB202211270805_1
1个文件已修改
36 ■■■■■ 已修改文件
force-app/main/default/classes/TenderInformationHandler.cls 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/TenderInformationHandler.cls
@@ -758,6 +758,7 @@
        Map<Id,Tender_information__c> tOldMap = (Map<Id,Tender_information__c>) Trigger.oldMap;
        Map<Id,Tender_information__c> tNewMap = (Map<Id,Tender_information__c>) Trigger.newMap;
        List<Date> cd = new List<Date>();
        System.debug(LoggingLevel.INFO, '*** cd: ' + cd);
        System.debug(LoggingLevel.INFO, '*** tOldMap: ' + tOldMap);
        for(Tender_information__c t:(List<Tender_information__c>) Trigger.new){
            System.debug(LoggingLevel.INFO, '*** 进入for循环: ');
@@ -781,20 +782,31 @@
            }
        }
        Map<Date,String> lm = new Map<Date,String>();
        for(OlympusCalendar__c oc:[SELECT Id,Date__c FROM OlympusCalendar__c WHERE Date__c IN:cd]){
            lm.put(oc.Date__c,oc.Id);
            System.debug(LoggingLevel.INFO, '*** map赋值: ');
        }
        for(Tender_information__c l:(List<Tender_information__c>) Trigger.new){
            if (l.relativeDate__c == null) {
                continue;
        if(cd.size() > 0){
            for(OlympusCalendar__c oc:[SELECT Id,Date__c FROM OlympusCalendar__c WHERE Date__c IN:cd]){
                lm.put(oc.Date__c,oc.Id);
                System.debug(LoggingLevel.INFO, '*** map赋值: ');
            }
            String datastr = String.valueOf(l.relativeDate__c);
            String dt = lm.get(Date.valueOf(datastr.substring(0,10)));
            l.Tender_Olympus__c = dt;
            System.debug(LoggingLevel.INFO, '*** l.Tender_Olympus__c: '+ l.Tender_Olympus__c);
            for(Tender_information__c l:(List<Tender_information__c>) Trigger.new){
                //lt 20221114 DB202211270805 【紧急】招标项目是否按时关联计算错误 start
                // if (l.relativeDate__c == null) {
                //     continue;
                // }
                if (l.relativeDate__c == null && l.OBSAP_relativeTime__c == null) {
                    continue;
                }
                Datetime relativetime = l.OBSAP_relativeTime__c != null ? l.OBSAP_relativeTime__c : l.relativeTime__c;
                // String datastr = String.valueOf(l.relativeDate__c);
                String datastr = String.valueOf(relativetime);
                //lt 20221114 DB202211270805 【紧急】招标项目是否按时关联计算错误 end
                String dt = lm.get(Date.valueOf(datastr.substring(0,10)));
                System.debug(LoggingLevel.INFO, '*** dt: '+ dt);
                l.Tender_Olympus__c = dt;
                System.debug(LoggingLevel.INFO, '*** l.Tender_Olympus__c: '+ l.Tender_Olympus__c);
            }
        }
    }
// fxk 2021/8/3 反逻辑删除 end
// 20210824 中标时修改关联询价的招标项目名和中标时间