yangjieke
2022-04-01 a1b500c74db7ed741ab4bebbd42530fd30b89bf9
SWAG-CCL6R7 补充
2个文件已修改
32 ■■■■■ 已修改文件
force-app/main/default/classes/TenderInformationHandler.cls 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/OpportunityBefUpd.trigger 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/TenderInformationHandler.cls
@@ -46,6 +46,7 @@
        if (!StaticParameter.EscapeOtherUpdateTenOwner) {
            updateTenOwner();
        }
    }
    protected override void afterInsert() {
@@ -58,6 +59,26 @@
        addShare();
        sednMessage();
        updateWin();
        //2022-3-29 yjk SWAG-CCL6R7
        updateOpportunity();
    }
    //2022-3-29 yjk SWAG-CCL6R7
    private void updateOpportunity(){
        for(Tender_information__c newOne : newList){
            Tender_information__c oldOne = oldMap.get(newOne.id);
            if(oldOne.ResultDate__c == null && newOne.ResultDate__c != null){
                List<Opportunity> oppList = [select id,Closing_Bid_Date__c  from Opportunity where Bidding_Project_Name_Bid__c = :newOne.id];
                if(oppList.size() > 0){
                    for(Opportunity opp : oppList){
                        opp.Closing_Bid_Date__c = newOne.ResultDate__c;
                    }
                    update oppList;
                }
            }
        }
    }
    public void sednMessage() {
force-app/main/default/triggers/OpportunityBefUpd.trigger
@@ -2,8 +2,10 @@
 * Opportunity作成後(コピー)、triggerにて集計項目をnullにする
 * 商談の「外貿/内貿」と「通貨」の値が一致させるトリガーです。
 * 商談の所有者【システム】に所有者のIdを入れる
 * OpportunityBefInsUpdTriggerTest
 */
trigger OpportunityBefUpd on Opportunity (before insert, before update) {
    List<String> idlist = new List<String>();
    if(Trigger.isInsert){
        //询价担当人和战略科室担当人不一致,在这里同步 20170512 XFUU-ALB9JK
@@ -50,6 +52,15 @@
            //if(ops.State_Owner__c == '能量') ops.STMS_Package_Sale__c = true;
            // opIds.add(ops.Id);
            // acs.add(ops.)
            //2022-3-29 yjk SWAG-CCL6R7
            Opportunity oldOne = Trigger.oldMap.get(ops.id);
            if(oldOne.Bidding_Project_Name_Bid__c==null  && ops.Bidding_Project_Name_Bid__c !=null ){
                List<Tender_information__c> ticList = [select id,ResultDate__c from Tender_information__c where id = :ops.Bidding_Project_Name_Bid__c];
                ops.Closing_Bid_Date__c = ticList.size() == 1? ticList.get(0).ResultDate__c : null ;
            }
        }
        // System.debug('====================='+opIds);
        // //在询价触发器里改这个验证,排除备品状态是取消的,只要是有备品,就不允许更改最终用户。