高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/CreateOpportunityTaskBatch.cls
@@ -42,6 +42,7 @@
        //2021-08-10  mzy  update   SWAG-C5R6GW   询价任务新增字段  start
        oppSql += ',Competitor__c,Close_Forecasted_Date__c,Created_Day__c,StageName__c,Bid_Date__c,Closing_Bid_Date__c ';
        //2021-08-10  mzy  update  SWAG-C5R6GW   询价任务新增字段  end
        oppSql += ', OCSM_RMB_Without_Tax_1000__c '; //2022-2-28 yjk 【委托】【询价任务】询价任务派送时点字段记录增加
        oppSql += ' from Opportunity ';
        // 询价科室分类(Opportunity_Category__c) 是GI
@@ -61,7 +62,9 @@
            oppSql += ' where id in :TEST_ID';
        }else{
            oppSql += ' where StageName = \'引合\' and ForecastAccuracyObject__c = true';
            oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级
            // oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级
            oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\') '; //2021-11-22 yjk 增加判断条件 询价等级
            oppSql += ' and IsNextMonthOfVisit__c = false and SalesdepartmentForecast__c in :areas';
            // 5)客户为H层客户的询价
            // oppSql += ' and (OCM__c = \'H0\' or OCM__c = \'H1\')';
@@ -162,6 +165,7 @@
                //2021-11-26 yjk 询价任务增加派发原因字段
                newTask.OCSM_RMB_Without_Tax_1000__c = opp.OCSM_RMB_Without_Tax_1000__c; //2022-2-28 yjk 【委托】【询价任务】询价任务派送时点字段记录增加
                if(opp.Close_Forecasted_Date__c >= nextMonthFirstDay && opp.Close_Forecasted_Date__c<= nnexMonthLastDay){
                    if(