高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/ET_Product_CategoryPrice_Table_Batch.cls
@@ -52,15 +52,16 @@
         *  }
         *  字段
         */
        // ETAPP重点产品拆分 fy start Category5__c
        String query = 'SELECT Id, Intra_Trade_List_RMB__c, Asset_Model_No__c,' +
                        ' Category3__c, Category4__c, Plan_Term__c' +
                        ' Category3__c, Category4__c,Category5__c, Plan_Term__c' +
                        ' FROM Product2' +
                        ' where Is_ET_APP__c = true ';
        // if (true != this.isAllFlag) {
        //        query += ' and LastModifiedDate >= :systemDate ';
        // }
               query += ' and Category3__c <> \'\' ' +
                        ' and Category5__c !=\'竞争对手\''+
                        ' and SFDA_Status__c in :s';
        return Database.getQueryLocator(query);
    }
@@ -93,6 +94,42 @@
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':先端系粘膜切开刀-DualJ以外';
                    }
                }
                // ETAPP重点产品拆分 fy start
                else if ('导丝' == pd.Category4__c ) {
                    if (pd.Asset_Model_No__c.startsWith('G-240')) {
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':导丝-G-240';
                    }else{
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':导丝-G-260';
                    }
                }
                else if('乳头切开刀' == pd.Category4__c){
                    if(pd.Category5__c.contains('乳头切开-三腔')){
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':乳头切开刀-三腔';
                    }else{
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':乳头切开刀-其他';
                    }
                } else if('注射针(胃镜)'== pd.Category4__c){
                    if (pd.Asset_Model_No__c.startsWith('NM-20')){
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':注射针(胃镜)-200';
                    }else{
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':注射针(胃镜)-400';
                    }
                }
                else if('注射针(肠镜)'== pd.Category4__c){
                    if (pd.Asset_Model_No__c.startsWith('NM-20')){
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':注射针(肠镜)-200';
                    }else{
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':注射针(肠镜)-400';
                    }
                }
                else if('呼吸科ET'==pd.Category3__c && '吸引活检针'==pd.Category4__c){
                    if(pd.Asset_Model_No__c.startsWith('NA-U401SX')||pd.Asset_Model_No__c.startsWith('NA-U403SX')){
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':吸引活检针-Visishot2';
                    }else{
                        uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':吸引活检针-Visishot2以外';
                    }
                }
                // ETAPP重点产品拆分 fy end
                if(uniKeyToPDListMap.get(uniKey) == null){
                    uniKeyToPDListMap.put(uniKey,new List<Product2>());