高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/NFM115Controller.cls
@@ -58,7 +58,8 @@
        BatchIF_Log__c rowData = null;
        try {
            List<Sample_order_list__c> samList = [select Id, AgentCode__c, DeliveryAddress__c, DeliveryContact__c, DeliveryPhone__c, Account__c, 
                                                    Account__r.City_Master__r.Level2_Sys_No__c
                                                    //Account__r.City_Master__r.name,Account__r.City_Master__c,
                                                    city__c,province__c
                                                    from Sample_order_list__c where Id IN:samIds];
            List<Sample_order_list_detail__c> samDetailList = [select id, ItemCode__c, ItemQuantity__c, Sample_order_list__c 
                                                                from Sample_order_list_detail__c where Sample_order_list__c IN:samIds];
@@ -70,7 +71,22 @@
                sample.DeliveryAddress = sam.DeliveryAddress__c;
                sample.DeliveryContact = sam.DeliveryContact__c;
                sample.DeliveryPhone   = sam.DeliveryPhone__c;
                sample.AreaCode        = sam.Account__r.City_Master__r.Level2_Sys_No__c;
                //modify by lyh 办事处订货接口市修改 2022/7/15 start
                /*if (String.isBlank(sam.Account__r.City_Master__c)) {
                    //sample.AreaCode        = null;
                }else {
                    sample.AreaCode = sam.Account__r.City_Master__r.name.substring(0,sam.Account__r.City_Master__r.name.length()-1);
                }*/
                // sample.AreaCode        = sam.Account__r.City_Master__r.name;
                //补填的地理信息
                String city = sam.city__c;
                if (sam.province__c.contains('市')) {
                    sample.AreaCode    = sam.province__c.substring(0,sam.province__c.length()-1);
                } else {
                    sample.AreaCode    = sam.city__c.substring(0,sam.city__c.length()-1);
                }
                //modify by lyh 办事处订货接口市修改 2022/7/15 end
                sample.Detail   = new List<Detail>();
                samples.Sample.add(sample);
                for(Sample_order_list_detail__c samDetail : samDetailList){