李彤
2023-05-18 49dfe80719274f1548737d2e73f78d0604081ccc
青岛拆分代码
5个文件已修改
417 ■■■■ 已修改文件
force-app/main/default/classes/AWSServiceTool2V2.cls 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/RepairBeforeInsertHandler.cls 236 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SetProvinceTargetController.cls 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/StartTradingController.cls 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/TenderLostController.cls 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/AWSServiceTool2V2.cls
@@ -76,18 +76,30 @@
        }
        //1.查询出对应修理的数据
        Repair__c repair = [select Id,Hospital__c,address_Contacts__c,AWS_Data_Id__c from Repair__c where id=:rid];
        // gzw DB202212270703 20230301 备品地址导入改造 start
        // Repair__c repair = [select Id,Hospital__c,address_Contacts__c,AWS_Data_Id__c from Repair__c where id=:rid];
        Repair__c repair = [select Id,Hospital__c,address_Contacts__c,AWS_Data_Id__c,Returns_Product_way__c,
                                Incharge_Staff__r.Profile.name,Incharge_Staff__r.UserRole.name,
                                Incharge_Staff__r.Branch__c from Repair__c where id=:rid];
        // gzw DB202212270703 20230301 备品地址导入改造 end
        Account ac = [SELECT id,OCM_man_province_txt__c,FieldCity_Master_Name__c from Account where id =:repair.Hospital__c];
        String province = '';
        String city = '';
        String provinceAndCity = '';
        if('山东' == ac.OCM_man_province_txt__c){
            if('烟台市' == ac.FieldCity_Master_Name__c || '威海市' == ac.FieldCity_Master_Name__c || '日照市' == ac.FieldCity_Master_Name__c
                || '青岛市' == ac.FieldCity_Master_Name__c || '潍坊市' == ac.FieldCity_Master_Name__c){
                provinceAndCity = matchupMap.get('山东,青岛市');
            }else{
                provinceAndCity = matchupMap.get('山东,济南市');
            }
        //DB202303246427 LY 20230329 start
        // if('山东' == ac.OCM_man_province_txt__c){
        //     if('烟台市' == ac.FieldCity_Master_Name__c || '威海市' == ac.FieldCity_Master_Name__c || '日照市' == ac.FieldCity_Master_Name__c
        //         || '青岛市' == ac.FieldCity_Master_Name__c || '潍坊市' == ac.FieldCity_Master_Name__c){
        //         provinceAndCity = matchupMap.get('山东,青岛市');
        //     }else{
        //         provinceAndCity = matchupMap.get('山东,济南市');
        //     }
        if ('青岛' == ac.OCM_man_province_txt__c) {
            provinceAndCity = matchupMap.get('山东,青岛市');
        }else if ('山东' == ac.OCM_man_province_txt__c) {
            provinceAndCity = matchupMap.get('山东,济南市');
        //DB202303246427 LY 20230329 end
        }else{
            provinceAndCity = matchupMap.get(ac.OCM_man_province_txt__c);
        }
@@ -95,12 +107,53 @@
            province = provinceAndCity.split(',')[0];
            city = provinceAndCity.split(',')[1];
        }
        String addressSQl = 'SELECT ID,AWS_Data_Id__c,Customer__c,Customer_Name__c,Contacts__c,Contacts__r.AWS_Data_Id__c,Contacts_Name__c,Telephone__c,Province__c,Province_Name__c,City__c,City_Name__c,Detailed_Address__c,ZipCode__c'
        + ' from Address__c  '
        + ' where Address_Classification__c =  \'办事处\' and Province_Name__c =: province and City_Name__c =: city '
        + ' order by Using_Datetime__c desc NULLS LAST ';
        system.debug('addressSQl='+addressSQl);
        // DB202212270703 20230301 备品地址导入改造 start
        String beipCenter = '';
        if (repair.Returns_Product_way__c == '备品中心') {
            if(repair.Incharge_Staff__c == null){
                beipCenter = '';
            }else if (repair.Incharge_Staff__r.Profile.name.startsWith('2B3')) {
                beipCenter = '北京备品中心';
            }else if (repair.Incharge_Staff__r.Profile.name.startsWith('2B2')) {
                if (repair.Incharge_Staff__r.Branch__c == '北京') {
                    beipCenter = '北京备品中心';
                }else if (repair.Incharge_Staff__r.Branch__c == '上海') {
                    beipCenter = '华东备品中心';
                }else if (repair.Incharge_Staff__r.Branch__c == '广州') {
                    beipCenter = '广州备品中心';
                }
            }else if (repair.Incharge_Staff__r.UserRole.name == 'CTEC教育本部') {
                if (repair.Incharge_Staff__r.Branch__c == '北京') {
                    beipCenter = '北京C-TEC';
                }else if (repair.Incharge_Staff__r.Branch__c == '上海') {
                    beipCenter = '上海C-TEC';
                }else if (repair.Incharge_Staff__r.Branch__c == '广州') {
                    beipCenter = '广州C-TEC';
                }
            }
        }
        system.debug('beipCenter=========='+beipCenter);
        String addressSQl = 'SELECT ID,AWS_Data_Id__c,Customer__c,Customer_Name__c,Contacts__c,Contacts__r.AWS_Data_Id__c,Contacts_Name__c,Telephone__c,Province__c,Province_Name__c,City__c,City_Name__c,Detailed_Address__c,ZipCode__c from Address__c ';
        if (String.isNotBlank(beipCenter)) {
            addressSQl += ' where Address_Classification__c =  \'备品\' and Beipin_Center__c = \'' + beipCenter + '\'';
        }else{
            addressSQl += ' where Address_Classification__c =  \'办事处\' and Province_Name__c =\'' + province + '\'';
            addressSQl += 'and City_Name__c =\'' + city + '\'';
        }
        addressSQl += ' order by Using_Datetime__c desc NULLS LAST ';
        system.debug('addressSQl=============='+addressSQl);
        List<Address__c> addressList = Database.query(addressSQl);
        // String addressSQl = 'SELECT ID,AWS_Data_Id__c,Customer__c,Customer_Name__c,Contacts__c,Contacts__r.AWS_Data_Id__c,Contacts_Name__c,Telephone__c,Province__c,Province_Name__c,City__c,City_Name__c,Detailed_Address__c,ZipCode__c'
        // + ' from Address__c  '
        // + ' where Address_Classification__c =  \'办事处\' and Province_Name__c =: province and City_Name__c =: city '
        // + ' order by Using_Datetime__c desc NULLS LAST ';
        // system.debug('addressSQl='+addressSQl);
        // List<Address__c> addressList = Database.query(addressSQl);
        // DB202212270703 20230301 备品地址导入改造 end
        //开始组装数据
        List<AWSServiceTool2V2.EncryptPushRequestBody> EncryptPushList = new List<AWSServiceTool2V2.EncryptPushRequestBody>();
        AWSServiceTool2V2.EncryptPushRequestBody EncryptPush = new AWSServiceTool2V2.EncryptPushRequestBody();
force-app/main/default/classes/RepairBeforeInsertHandler.cls
@@ -56,12 +56,20 @@
        List<String> HospitalId = new List<String>();
        List<String> provinceList = new List<String>();//省
        List<String> cityList = new List<String>();//市
        List<String> inchargeStaff = new List<String>();//市
        for (Repair__c nObj : newList) {
            //医院的CSM管理省(文本) 值不为空,并且收货地址不为空
            if(nObj.Hospital__c != null && nObj.address_Contacts__c == null && nObj.address_Telephone__c == null && nObj.address_Contacts_Name__c == null && nObj.address_City__c == null && nObj.Detailed_Address__c == null){
                HospitalId.add(nObj.Hospital__C);
            }
            inchargeStaff.add(nObj.Incharge_Staff__c);
        }
        // gzw DB202212270703 20230301 备品地址导入改造 start
        Map<String,user> profileAndRoleMap = new Map<String,user>();
        for(user re :[select id,Profile.name,Branch__c,UserRole.name from user where id in :inchargeStaff]){
            profileAndRoleMap.put(re.id, re);
        }
        // gzw DB202212270703 20230301 备品地址导入改造 start
        if(HospitalId != null && HospitalId.size() > 0){
            String HospitalSQl = 'SELECT id,OCM_man_province_txt__c,FieldCity_Master_Name__c from Account where id in :HospitalId';
            List<Account> accountList = Database.query(HospitalSQl);
@@ -70,13 +78,19 @@
                    for(Account ac : accountList){
                        if(nObj.Hospital__c == ac.id){
                            String provinceAndCity = '';
                            if('山东' == ac.OCM_man_province_txt__c){
                                if('烟台市' == ac.FieldCity_Master_Name__c || '威海市' == ac.FieldCity_Master_Name__c || '日照市' == ac.FieldCity_Master_Name__c
                                    || '青岛市' == ac.FieldCity_Master_Name__c || '潍坊市' == ac.FieldCity_Master_Name__c){
                                    provinceAndCity = matchupMap.get('山东,青岛市');
                                }else{
                                    provinceAndCity = matchupMap.get('山东,济南市');
                                }
                            //DB202303246427 LY 20230329 start
                            // if('山东' == ac.OCM_man_province_txt__c){
                            //     if('烟台市' == ac.FieldCity_Master_Name__c || '威海市' == ac.FieldCity_Master_Name__c || '日照市' == ac.FieldCity_Master_Name__c
                            //         || '青岛市' == ac.FieldCity_Master_Name__c || '潍坊市' == ac.FieldCity_Master_Name__c){
                            //         provinceAndCity = matchupMap.get('山东,青岛市');
                            //     }else{
                            //         provinceAndCity = matchupMap.get('山东,济南市');
                            //     }
                            if('青岛' == ac.OCM_man_province_txt__c){
                                provinceAndCity = matchupMap.get('山东,青岛市');
                            }else if ('山东' == ac.OCM_man_province_txt__c) {
                                provinceAndCity = matchupMap.get('山东,济南市');
                            //DB202303246427 LY 20230329 end
                            }else{
                                provinceAndCity = matchupMap.get(ac.OCM_man_province_txt__c);
                            }
@@ -93,79 +107,169 @@
            system.debug('cityList='+cityList);
            system.debug('provinceList='+provinceList);
            if(falg && provinceList != null && cityList != null && provinceList.size() > 0 && cityList.size() > 0){
                String addressSQl = 'SELECT ID,Customer__c,Customer_Name__c,Contacts__c,Contacts_Name__c,Telephone__c,Province__c,Province_Name__c,City__c,City_Name__c,Detailed_Address__c,ZipCode__c'
                                //+ ',Contacts__r.LastName_Encrypted__c,ZipCode_Encrypted__c,Detailed_Address_Encrypted__c,Telephone_Encrypted__c' // PI改造 By Bright 20220407 zhj MEBG新方案改造 2022-11-29
                // gzw DB202212270703 20230301 备品地址导入改造 start
                // String addressSQl = 'SELECT ID,Customer__c,Customer_Name__c,Contacts__c,Contacts_Name__c,Telephone__c,Province__c,Province_Name__c,City__c,City_Name__c,Detailed_Address__c,ZipCode__c'
                //                 //+ ',Contacts__r.LastName_Encrypted__c,ZipCode_Encrypted__c,Detailed_Address_Encrypted__c,Telephone_Encrypted__c' // PI改造 By Bright 20220407 zhj MEBG新方案改造 2022-11-29
                //                 + ' from Address__c  '
                //                 + ' where Address_Classification__c =  \'办事处\' and Province_Name__c in :provinceList and City_Name__c in :cityList '
                //                 + ' order by Using_Datetime__c desc NULLS LAST ';
                String addressSQl = 'SELECT ID,Customer__c,Customer_Name__c,Contacts__c,Contacts_Name__c,Telephone__c,Province__c,Province_Name__c,City__c,City_Name__c,Detailed_Address__c,ZipCode__c '
                                + ' ,Address_Classification__c,Beipin_Center__c  '
                                //+ ',Contacts__r.LastName_Encrypted__c,ZipCode_Encrypted__c,Detailed_Address_Encrypted__c,Telephone_Encrypted__c' // PI改造 By Bright 20220407 zhj MEBG新方案改造 2022-11-29
                                + ' from Address__c  '
                                + ' where Address_Classification__c =  \'办事处\' and Province_Name__c in :provinceList and City_Name__c in :cityList '
                                + ' where ( Address_Classification__c =  \'办事处\' and Province_Name__c in :provinceList and City_Name__c in :cityList )'
                                + ' or Address_Classification__c =  \'备品\''
                                + ' order by Using_Datetime__c desc NULLS LAST ';
                // gzw DB202212270703 20230301 备品地址导入改造 end
                system.debug('addressSQl='+addressSQl);
                List<Address__c> addressList = Database.query(addressSQl);
                if(addressList != null && addressList.size() > 0){
                    system.debug(addressList[0]);
                List<Address__c> addressList = new List<Address__c>();
                Map<String,Address__c> beipinMap = new Map<String,Address__c>();
                List<Address__c> addressTempList = Database.query(addressSQl);
                for (Address__c ad :addressTempList) {
                    if (ad.Address_Classification__c == '备品') {
                        beipinMap.put(ad.Beipin_Center__c,ad);
                    }else{
                        addressList.add(ad);
                    }
                }
                //List<Address__c> addressList = Database.query(addressSQl);
                System.debug('进入备品+++++addressTempList ' + addressTempList.size());
                // if(addressList != null && addressList.size() > 0){
                if(addressTempList != null && addressTempList.size() > 0){
                    for (Repair__c nObj : newList) {
                        if(nObj.Hospital__c != null && nObj.address_Contacts__c == null && nObj.address_Telephone__c == null && nObj.address_Contacts_Name__c == null && nObj.address_City__c == null && nObj.Detailed_Address__c == null){
                            //由于为了减少select ,所以获取我们配置好的map,根据保有设备上医院的 OCSM管理省(文本) 的值,获取对应的地址上的省和市
                            for(Account ac : accountList){
                                if(nObj.Hospital__c == ac.id){
                                    String provinceAndCity = '';
                                    matchupMap.get(ac.OCM_man_province_txt__c);
                                    if('山东' == ac.OCM_man_province_txt__c){
                                        if('烟台市' == ac.FieldCity_Master_Name__c || '威海市' == ac.FieldCity_Master_Name__c || '日照市' == ac.FieldCity_Master_Name__c
                                            || '青岛市' == ac.FieldCity_Master_Name__c || '潍坊市' == ac.FieldCity_Master_Name__c){
                        System.debug('进入备品+++++ ');
                        if (nObj.Returns_Product_way__c == '备品中心') {
                            user re = profileAndRoleMap.get(nObj.Incharge_Staff__c);
                            if (re == null) return;
                            String beipCenter = '';
                            if (re.Profile.name.startsWith('2B3')) {
                                beipCenter = '北京备品中心';
                            }else if (re.Profile.name.startsWith('2B2')) {
                                if (re.Branch__c == '北京') {
                                    beipCenter = '北京备品中心';
                                }else if (re.Branch__c == '上海') {
                                    beipCenter = '华东备品中心';
                                }else if (re.Branch__c == '广州') {
                                    beipCenter = '广州备品中心';
                                }
                            }else if (re.UserRole.name == 'CTEC教育本部') {
                                if (re.Branch__c == '北京') {
                                    beipCenter = '北京C-TEC';
                                }else if (re.Branch__c == '上海') {
                                    beipCenter = '上海C-TEC';
                                }else if (re.Branch__c == '广州') {
                                    beipCenter = '广州C-TEC';
                                }
                            }
                            System.debug('进入备品+++++ beipCenter' + beipCenter);
                            if(String.isNotBlank(beipCenter)){
                                Address__c addressbeip = beipinMap.get(beipCenter);
                                System.debug('进入备品+++++ addressbeip' + addressbeip.id);
                                //联系人
                                String contactsName = '';
                                String contactsNameEncrypt = '';
                                if(!String.isBlank(addressbeip.Contacts__c)){
                                    contactsName = addressbeip.Contacts_Name__c;
                                }
                                //省+市
                                String address = addressbeip.Detailed_Address__c.trim();
                                String cityName = addressbeip.City_Name__c.trim();
                                String ProvinceCity = addressbeip.Province_Name__c.trim()+cityName;
                                //防止详细地址里面带着省份和市
                                if(!address.contains(ProvinceCity)){
                                    address = ProvinceCity + address;
                                }
                                //联系人
                                String ContactPerson = '';
                                if(!String.isBlank(addressbeip.Customer__c)){
                                    ContactPerson = addressbeip.Customer_Name__c;
                                }
                                nObj.address_Contacts__c=contactsName;
                                nObj.address_ZipCode__c = addressbeip.ZipCode__c;
                                nObj.address_City__c = cityName;
                                nObj.address_Contacts_Name__c = ContactPerson;
                                nObj.address_Telephone__c=addressbeip.Telephone__c;
                                nObj.Detailed_Address__c=address;
                                nObj.Encrypt_Update_Flag__c=true;
                                system.debug('nObj assign and Encrypt_Update_Flag__c set true');
                            }
                        }else{
                            if(nObj.Hospital__c != null && nObj.address_Contacts__c == null && nObj.address_Telephone__c == null && nObj.address_Contacts_Name__c == null && nObj.address_City__c == null && nObj.Detailed_Address__c == null){
                                //由于为了减少select ,所以获取我们配置好的map,根据保有设备上医院的 OCSM管理省(文本) 的值,获取对应的地址上的省和市
                                for(Account ac : accountList){
                                    if(nObj.Hospital__c == ac.id){
                                        String provinceAndCity = '';
                                        matchupMap.get(ac.OCM_man_province_txt__c);
                                        //DB202303246427 LY 20230329 start
                                        // if('山东' == ac.OCM_man_province_txt__c){
                                        //     if('烟台市' == ac.FieldCity_Master_Name__c || '威海市' == ac.FieldCity_Master_Name__c || '日照市' == ac.FieldCity_Master_Name__c
                                        //         || '青岛市' == ac.FieldCity_Master_Name__c || '潍坊市' == ac.FieldCity_Master_Name__c){
                                        //         provinceAndCity = matchupMap.get('山东,青岛市');
                                        //     }else{
                                        //         provinceAndCity = matchupMap.get('山东,济南市');
                                        //     }
                                        if ('青岛' == ac.OCM_man_province_txt__c) {
                                            provinceAndCity = matchupMap.get('山东,青岛市');
                                        }else{
                                        }else if ('山东' == ac.OCM_man_province_txt__c) {
                                            provinceAndCity = matchupMap.get('山东,济南市');
                                        //DB202303246427 LY 20230329 end
                                        }else{
                                            provinceAndCity = matchupMap.get(ac.OCM_man_province_txt__c);
                                        }
                                    }else{
                                        provinceAndCity = matchupMap.get(ac.OCM_man_province_txt__c);
                                    }
                                    system.debug('provinceAndCity='+provinceAndCity);
                                    if(provinceAndCity != null){//不能为空
                                        //地址表上省和市不能为空
                                        if(addressList[0].Province_Name__c != null && addressList[0].City_Name__c!= null){
                                            //拼接一个字符串方便对比
                                            String pAc = addressList[0].Province_Name__c + ',' + addressList[0].City_Name__c;
                                            if(provinceAndCity.equals(pAc)){
                                                //联系人
                                                String contactsName = '';
                                                String contactsNameEncrypt = '';// 20220407 PI改造 By Bright
                                                if(!String.isBlank(addressList[0].Contacts__c)){
                                                    contactsName = addressList[0].Contacts_Name__c;
                                                    //contactsNameEncrypt = addressList[0].Contacts__r.LastName_Encrypted__c;// 20220407 PI改造 By Bright   zhj MEBG新方案改造 2022-11-29
                                        system.debug('provinceAndCity='+provinceAndCity);
                                        if(provinceAndCity != null){//不能为空
                                            //地址表上省和市不能为空
                                            if(addressList[0].Province_Name__c != null && addressList[0].City_Name__c!= null){
                                                //拼接一个字符串方便对比
                                                String pAc = addressList[0].Province_Name__c + ',' + addressList[0].City_Name__c;
                                                if(provinceAndCity.equals(pAc)){
                                                    //联系人
                                                    String contactsName = '';
                                                    String contactsNameEncrypt = '';// 20220407 PI改造 By Bright
                                                    if(!String.isBlank(addressList[0].Contacts__c)){
                                                        contactsName = addressList[0].Contacts_Name__c;
                                                        //contactsNameEncrypt = addressList[0].Contacts__r.LastName_Encrypted__c;// 20220407 PI改造 By Bright   zhj MEBG新方案改造 2022-11-29
                                                    }
                                                    //省+市
                                                    String address = addressList[0].Detailed_Address__c.trim();
                                                    //String addressEncrypt = addressList[0].Detailed_Address_Encrypted__c;   zhj MEBG新方案改造 2022-11-29
                                                    String cityName = addressList[0].City_Name__c.trim();
                                                    String ProvinceCity = addressList[0].Province_Name__c.trim()+cityName;
                                                    //防止详细地址里面带着省份和市
                                                    if(!address.contains(ProvinceCity)){
                                                        address = ProvinceCity + address;
                                                    }
                                                    //联系人
                                                    String ContactPerson = '';
                                                    if(!String.isBlank(addressList[0].Customer__c)){
                                                        ContactPerson = addressList[0].Customer_Name__c;
                                                    }
                                                    nObj.address_Contacts__c=contactsName;
                                                    //nObj.address_Contacts_Encrypt__c=contactsNameEncrypt;// 20220407 PI改造 By Bright   zhj MEBG新方案改造 2022-11-29
                                                    nObj.address_ZipCode__c = addressList[0].ZipCode__c;
                                                    //nObj.address_ZipCode_Encrypt__c = addressList[0].ZipCode_Encrypted__c;// 20220407 PI改造 By Bright   zhj MEBG新方案改造 2022-11-29
                                                    nObj.address_City__c = cityName;
                                                    nObj.address_Contacts_Name__c = ContactPerson;
                                                    nObj.address_Telephone__c=addressList[0].Telephone__c;
                                                    //nObj.address_Telephone_Encrypt__c=addressList[0].Telephone_Encrypted__c;// 20220407 PI改造 By Bright  zhj MEBG新方案改造 2022-11-29
                                                    nObj.Detailed_Address__c=address;
                                                    //nObj.Detailed_Address_Encrypt__c=addressEncrypt;// 20220407 PI改造 By Bright   zhj MEBG新方案改造 2022-11-29
                                                    nObj.Encrypt_Update_Flag__c=true;// 20220411 PI改造 By Bright
                                                    system.debug('nObj assign and Encrypt_Update_Flag__c set true');
                                                }
                                                //省+市
                                                String address = addressList[0].Detailed_Address__c.trim();
                                                //String addressEncrypt = addressList[0].Detailed_Address_Encrypted__c;   zhj MEBG新方案改造 2022-11-29
                                                String cityName = addressList[0].City_Name__c.trim();
                                                String ProvinceCity = addressList[0].Province_Name__c.trim()+cityName;
                                                //防止详细地址里面带着省份和市
                                                if(!address.contains(ProvinceCity)){
                                                    address = ProvinceCity + address;
                                                }
                                                //联系人
                                                String ContactPerson = '';
                                                if(!String.isBlank(addressList[0].Customer__c)){
                                                    ContactPerson = addressList[0].Customer_Name__c;
                                                }
                                                nObj.address_Contacts__c=contactsName;
                                                //nObj.address_Contacts_Encrypt__c=contactsNameEncrypt;// 20220407 PI改造 By Bright   zhj MEBG新方案改造 2022-11-29
                                                nObj.address_ZipCode__c = addressList[0].ZipCode__c;
                                                //nObj.address_ZipCode_Encrypt__c = addressList[0].ZipCode_Encrypted__c;// 20220407 PI改造 By Bright   zhj MEBG新方案改造 2022-11-29
                                                nObj.address_City__c = cityName;
                                                nObj.address_Contacts_Name__c = ContactPerson;
                                                nObj.address_Telephone__c=addressList[0].Telephone__c;
                                                //nObj.address_Telephone_Encrypt__c=addressList[0].Telephone_Encrypted__c;// 20220407 PI改造 By Bright  zhj MEBG新方案改造 2022-11-29
                                                nObj.Detailed_Address__c=address;
                                                //nObj.Detailed_Address_Encrypt__c=addressEncrypt;// 20220407 PI改造 By Bright   zhj MEBG新方案改造 2022-11-29
                                                nObj.Encrypt_Update_Flag__c=true;// 20220411 PI改造 By Bright
                                                system.debug('nObj assign and Encrypt_Update_Flag__c set true');
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
force-app/main/default/classes/SetProvinceTargetController.cls
@@ -653,7 +653,7 @@
            //20210225 ljh WLIG-BV8CHF update  财年 end
            isPast = false;
            if (iYear < currentYear) {
                isPast = true;
                isPast = true;
            } else if (iYear == currentYear) {
                if (Date.today().month() == 3) {
                    isPast = true;
@@ -998,7 +998,10 @@
        List<OCM_Management_Province__c> OCM_MpList = [select Id,Province__c,GI_assistant__c,SP_assistant__c,Name from OCM_Management_Province__c where Province__c in :AllOwnerSystem ];
        for ( OCM_Management_Province__c OCM_Mp : OCM_MpList ) {
            //过滤掉不符合条件的数据 fy
            if(OCM_Mp.Name!='集采课'&&OCM_Mp.Name!='青岛'){
            // 20230329 ljh start
            // if(OCM_Mp.Name!='集采课'&&OCM_Mp.Name!='青岛'){
            if(OCM_Mp.Name!='集采课'){
            // 20230329 ljh end
                OCM_MpMap.put(OCM_Mp.Province__c, OCM_Mp);
            }
        }
force-app/main/default/classes/StartTradingController.cls
@@ -83,6 +83,7 @@
                     Tender_information__c, Agency_Opportunity__c, SI_PromoteInquiry__c 
                     ,    Contact_Name__r.AccountId //2022-6-20 yjk 增加联系人的科室查询
                     ,ET_Check__c //SWAG-CKDATG fy 【委托】【OBSAP-报价委托】报价委托项目改善1
                     ,Hospital_Name__r.Parent.Parent.OCM_man_province_HP__c  //20230329 lt DB202303246427 --青岛拆分 -- 根据询“省(客户)”赋值SAP上传省 add
                     from Lead where id =: this.leadId];
        this.SI_Flg = this.lead.SI_PromoteInquiry__c;           
        // 診療科選択リストの取得(条件:病院=リード情報の病院名称)
@@ -402,7 +403,50 @@
        //**********************************************************************************
        opp.Sales_Method__c = this.lead.Sales_Method__c;
        opp.Fund_Basis__c = this.lead.Fund_Basis__c;
        opp.SAP_Province__c = this.leadOnwer.Province_Text__c;
        //20230329 lt DB202303246427 --青岛拆分 -- 根据询“省(客户)”赋值SAP上传省 start
        // opp.SAP_Province__c = this.leadOnwer.Province_Text__c;
        System.debug('lt123---this.lead.Hospital_Name__r.Parent.Parent.OCM_man_province_HP__c:'+this.lead.Hospital_Name__r.Parent.Parent.OCM_man_province_HP__c);
        Map<String,String> SAP_ProvinceMap = new Map<String,String>();
        SAP_ProvinceMap.put('宁夏','宁夏自治区');
        SAP_ProvinceMap.put('新疆','新疆自治区');
        SAP_ProvinceMap.put('黑龙江','黑龙江省');
        SAP_ProvinceMap.put('广西','广西自治区');
        SAP_ProvinceMap.put('大连','大连市');
        SAP_ProvinceMap.put('沈阳','辽宁省');    //暂时辽宁
        SAP_ProvinceMap.put('广东','广东省');
        SAP_ProvinceMap.put('深圳','深圳市');
        SAP_ProvinceMap.put('青岛','青岛市');
        SAP_ProvinceMap.put('山东','山东省');
        SAP_ProvinceMap.put('四川/西藏','四川省');
        SAP_ProvinceMap.put('安徽','安徽省');
        SAP_ProvinceMap.put('北京','北京市');
        SAP_ProvinceMap.put('福建','福建省');
        SAP_ProvinceMap.put('甘肃','甘肃省');
        SAP_ProvinceMap.put('贵州','贵州省');
        SAP_ProvinceMap.put('河北','河北省');
        SAP_ProvinceMap.put('河南','河南省');
        SAP_ProvinceMap.put('湖北','湖北省');
        SAP_ProvinceMap.put('湖南','湖南省');
        SAP_ProvinceMap.put('吉林','吉林省');
        SAP_ProvinceMap.put('江苏','江苏省');
        SAP_ProvinceMap.put('江西','江西省');
        SAP_ProvinceMap.put('青海','青海省');
        SAP_ProvinceMap.put('山西','山西省');
        SAP_ProvinceMap.put('陕西','陕西省');
        SAP_ProvinceMap.put('上海','上海市');
        SAP_ProvinceMap.put('天津','天津市');
        SAP_ProvinceMap.put('云南','云南省');
        SAP_ProvinceMap.put('浙江','浙江省');
        SAP_ProvinceMap.put('重庆','重庆市');
        SAP_ProvinceMap.put('海南','海南省');
        //内蒙古一致
        String SAP_Province = this.lead.Hospital_Name__r.Parent.Parent.OCM_man_province_HP__c;
        if(SAP_ProvinceMap.containsKey(SAP_Province)){
            SAP_Province = SAP_ProvinceMap.get(SAP_Province);
        }
        opp.SAP_Province__c = SAP_Province;
        //20230329 lt DB202303246427 --青岛拆分 -- 根据询“省(客户)”赋值SAP上传省 end
        opp.Owner_System__c = opp.OwnerId;
        if(this.lead.OwnerId != null ){
            opp.Ownerid = this.lead.OwnerId ;
force-app/main/default/classes/TenderLostController.cls
@@ -56,7 +56,9 @@
        System.debug('lt123test01默认询价内容'+opp);
        // 查找科室相关信息
        Account acc = [select Id, Name, Parent.Parent.State_Master__r.Name, Parent.Department_Class_Label__c from Account where Id = :opp.AccountId];
        Account acc = [select Id, Name, Parent.Parent.State_Master__r.Name, Parent.Department_Class_Label__c
                        ,Parent.Parent.OCM_man_province_HP__c  //20230329 lt DB202303246427 --青岛拆分 -- 根据询“省(客户)”赋值SAP上传省 add
                       from Account where Id = :opp.AccountId];
        System.debug('lt123test02默认询价内容'+opp);
        // 20221205 ljh DB202212030068 start
@@ -66,12 +68,49 @@
        新疆维吾尔自治区--->新疆自治区
        黑龙江--->黑龙江省*/
        // opp.SAP_Province__c = acc.Parent.Parent.State_Master__r.Name; // SAP上传省
        //20230329 lt DB202303246427 --青岛拆分 -- 根据询“省(客户)”赋值SAP上传省 start
        Map<String,String> SAP_ProvinceMap = new Map<String,String>();
        SAP_ProvinceMap.put('内蒙古自治区','内蒙古');
        SAP_ProvinceMap.put('宁夏回族自治区','宁夏自治区');
        SAP_ProvinceMap.put('新疆维吾尔自治区','新疆自治区');
        // SAP_ProvinceMap.put('内蒙古自治区','内蒙古');
        // SAP_ProvinceMap.put('宁夏回族自治区','宁夏自治区');
        // SAP_ProvinceMap.put('新疆维吾尔自治区','新疆自治区');
        // SAP_ProvinceMap.put('黑龙江','黑龙江省');
        SAP_ProvinceMap.put('宁夏','宁夏自治区');
        SAP_ProvinceMap.put('新疆','新疆自治区');
        SAP_ProvinceMap.put('黑龙江','黑龙江省');
        String SAP_Province = acc.Parent.Parent.State_Master__r.Name;
        SAP_ProvinceMap.put('广西','广西自治区');
        SAP_ProvinceMap.put('大连','大连市');
        SAP_ProvinceMap.put('沈阳','辽宁省');    //暂定辽宁
        SAP_ProvinceMap.put('广东','广东省');
        SAP_ProvinceMap.put('深圳','深圳市');
        SAP_ProvinceMap.put('青岛','青岛市');
        SAP_ProvinceMap.put('山东','山东省');
        SAP_ProvinceMap.put('四川/西藏','四川省');
        SAP_ProvinceMap.put('安徽','安徽省');
        SAP_ProvinceMap.put('北京','北京市');
        SAP_ProvinceMap.put('福建','福建省');
        SAP_ProvinceMap.put('甘肃','甘肃省');
        SAP_ProvinceMap.put('贵州','贵州省');
        SAP_ProvinceMap.put('河北','河北省');
        SAP_ProvinceMap.put('河南','河南省');
        SAP_ProvinceMap.put('湖北','湖北省');
        SAP_ProvinceMap.put('湖南','湖南省');
        SAP_ProvinceMap.put('吉林','吉林省');
        SAP_ProvinceMap.put('江苏','江苏省');
        SAP_ProvinceMap.put('江西','江西省');
        SAP_ProvinceMap.put('青海','青海省');
        SAP_ProvinceMap.put('山西','山西省');
        SAP_ProvinceMap.put('陕西','陕西省');
        SAP_ProvinceMap.put('上海','上海市');
        SAP_ProvinceMap.put('天津','天津市');
        SAP_ProvinceMap.put('云南','云南省');
        SAP_ProvinceMap.put('浙江','浙江省');
        SAP_ProvinceMap.put('重庆','重庆市');
        SAP_ProvinceMap.put('海南','海南省');
        //内蒙古一致
        // String SAP_Province = acc.Parent.Parent.State_Master__r.Name;
        String SAP_Province = acc.Parent.Parent.OCM_man_province_HP__c;
        //20230329 lt DB202303246427 --青岛拆分 -- 根据询“省(客户)”赋值SAP上传省 end
        if(SAP_ProvinceMap.containsKey(SAP_Province)){
            SAP_Province = SAP_ProvinceMap.get(SAP_Province);
        }