buli
2023-06-05 e9e1806b0f4b5bae1fc36204ccc5d6fdad52d66f
force-app/main/default/classes/PrintConsumblePDFController.cls
@@ -52,6 +52,7 @@
            Order_ForHospital__c,Deliver_date__c,Order_Reason__c,
            Order_date__c,Total_amount__c,Order_ProType__c,
            Offers_Price__c,Order_effective_contact__r.Business_Assistant__r.Province_Text__c
            ,Order_effective_contact__r.OSH_Dealer__c  //20230323 lt DB202303088261 两票制 add
            From Consumable_order__c 
            Where Id =:ESetId];
         if (qs.size()>0){
@@ -91,7 +92,6 @@
                                    Consumable_Product__r.Product2__r.SalesPackagingUnit_Chinese__c,
                                    Consumable_Product__r.Product2__r.ProduceCompany_F__c,
                                    Consumable_Product__r.Product2__r.ProduceCompany__c,
                                    Consumable_Product__r.Product2__r.ProduceCompanySummary__c,
                                    Sum_of_money__c,
                                    Dealer_Custom_Price__c,
                                    Lose_reason__c,
@@ -123,21 +123,21 @@
                nowRightAsstModelNo = '';
            }
            nameStringArray = new List<String>();
            repeatCount = (nowName.length() / nameMax) + ( Math.mod( nowName.length(), nameMax) > 0 ? 1 : 0);
            // 20220824 ljh SWAG-CHKAMM update start
            // repeatCount = (nowName.length() / nameMax) + ( Math.mod( nowName.length(), nameMax) > 0 ? 1 : 0);
            if(String.isBlank(nowName)){
                repeatCount = 1;
            }else{
                repeatCount = (nowName.length() / nameMax) + ( Math.mod( nowName.length(), nameMax) > 0 ? 1 : 0);
            }
            // 20220824 ljh SWAG-CHKAMM update end
            //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING, 'repeatCount!' + repeatCount));
            // 生产企业 注释原代码
            // nowCompany = itemsOrg[i].Consumable_Product__r.Product2__r.ProduceCompany_F__c;
            String nowCompany = null;
            //CHAN-C4X63A 【委托】NFM204字段“生产企业地址”优化 XHL 20210716 Start
            //if(itemsOrg[i].Consumable_Product__r.Product2__r.ProduceCompany__c !=null){
            //    nowCompany = getProduceCompanyName(itemsOrg[i].Consumable_Product__r.Product2__r.ProduceCompany__c);
            //}
            if(itemsOrg[i].Consumable_Product__r.Product2__r.ProduceCompanySummary__c !=null){
                nowCompany = getProduceCompanyName(itemsOrg[i].Consumable_Product__r.Product2__r.ProduceCompanySummary__c);
            if(itemsOrg[i].Consumable_Product__r.Product2__r.ProduceCompany__c !=null){
                nowCompany = getProduceCompanyName(itemsOrg[i].Consumable_Product__r.Product2__r.ProduceCompany__c);
            }
            //CHAN-C4X63A 【委托】NFM204字段“生产企业地址”优化 XHL 20210716 End
            if (nowCompany == null) nowCompany = '';
            //hasEnglish = Pattern.matches('.*[a-zA-Z]+.*', nowCompany);
            //Integer companyMax = hasEnglish ? 16 : 12;
@@ -260,6 +260,7 @@
        '河南省' => '奥林巴斯(北京)销售服务有限公司',
        '浙江省' => '奥林巴斯(北京)销售服务有限公司上海分公司',
        '安徽省' => '奥林巴斯(北京)销售服务有限公司上海分公司',
        'OSH-安徽省' => '奥林巴斯贸易(上海)有限公司',   //20230323 lt DB202303088261 两票制 add
        '江西省' => '奥林巴斯(北京)销售服务有限公司上海分公司',
        '福建省' => '奥林巴斯(北京)销售服务有限公司上海分公司',
        '江苏省' => '奥林巴斯(北京)销售服务有限公司上海分公司',
@@ -270,7 +271,17 @@
        //CHAN-B42D6F 安徽ET特约经销商来的询价  SAP上传省 紧急对应为北京 以后会修改 TODO
        //CHAN-BTF64C 安徽ENG经销商的询价默认SAP上传省修改 update by rentongxiao 2020-09-14 start
        // String province = coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c == '安徽省'  ? '北京市' : coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c;
        String province = coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c == '安徽省' && coc.Order_ProType__c == 'ET'  ? '北京市' : coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c;
        //20230323 lt DB202303088261 两票制 start
        String province = '';
        if(coc.Order_effective_contact__r.OSH_Dealer__c == TRUE){
            province = 'OSH-安徽省';
        }else if(coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c == '安徽省' && coc.Order_ProType__c == 'ET'){
            province = '北京市';
        }else{
            province = coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c;
        }
        // String province = coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c == '安徽省' && coc.Order_ProType__c == 'ET'  ? '北京市' : coc.Order_effective_contact__r.Business_Assistant__r.Province_Text__c;
        //20230323 lt DB202303088261 两票制 end
        //CHAN-BTF64C 安徽ENG经销商的询价默认SAP上传省修改 update by rentongxiao 2020-09-14 end