From 0f44cb1a0b7b36860e9ce81c1eac9e395d87f0b4 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期一, 05 六月 2023 13:53:18 +0800
Subject: [PATCH] mergecode into lex dtt

---
 force-app/main/default/classes/SaleOrderController.cls |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/classes/SaleOrderController.cls b/force-app/main/default/classes/SaleOrderController.cls
index eb8a1ab..e8c3067 100644
--- a/force-app/main/default/classes/SaleOrderController.cls
+++ b/force-app/main/default/classes/SaleOrderController.cls
@@ -222,10 +222,12 @@
         List<hospitalprice__c> hpList = [select id,hospital__c,product__c from hospitalprice__c where account__c = :accountid];
         if (hpList!= null && hpList.size() > 0) {
             for (hospitalprice__c hp : hpList) {
-                proIdMap.put((''+hp.product__c).subString(0,15)+'鏄�', '');
-                if (hp.hospital__c ==coc.Order_ForHospital__c) {
-                    proHosMap.put((''+hp.product__c).subString(0,15)+'鏄�', '');
-                }
+                if(hp.product__c!=null && String.valueof(hp.product__c).length()>=15){//Add by Li Jun for issue fix 20230403 
+                    proIdMap.put((''+hp.product__c).subString(0,15)+'鏄�', '');
+                    if (hp.hospital__c ==coc.Order_ForHospital__c) {
+                        proHosMap.put((''+hp.product__c).subString(0,15)+'鏄�', '');
+                    }
+                }               
             }
         }
 
@@ -676,10 +678,24 @@
                     }else if(!checkBarcodeResult.containsKey(newdet2[j].Bar_Code__c)) {
                         Matcher n = Pattern.compile('[0-9]').matcher(newdet2[j].TracingCode__c);
                         if(n.find()){
-                            String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
-                            consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j],str));
-                            errorIdMap.put(newdet2[j].Bar_Code__c,newdet2[j].Bar_Code__c);
-                            continue;
+                            // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+                            if (newdet2[j].TracingCode__c.length() == 5) {
+                                String tr = newdet2[j].TracingCode__c;
+                                String Ctr = tr.substring(tr.length() - 3,tr.length());
+                                String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+                                String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+                                if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+                                    String str = '绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�';
+                                    consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j],str));
+                                    errorIdMap.put(newdet2[j].Bar_Code__c,newdet2[j].Bar_Code__c);
+                                    continue;
+                                }
+                            }
+                            // String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
+                            // consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j],str));
+                            // errorIdMap.put(newdet2[j].Bar_Code__c,newdet2[j].Bar_Code__c);
+                            // continue;
+                            // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
                         }
                         checkBarcodeResult.put(newdet2[j].Bar_Code__c, newdet2[j].Bar_Code__c);
                         consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(newdet2[j]));

--
Gitblit v1.9.1