高章伟
2023-05-24 2b969ede326bf33a9a0402ea96a0261631591dc4
入库管理编码验证程序调整
2个文件已修改
209 ■■■■ 已修改文件
force-app/main/default/classes/ArriveGoodsController.cls 187 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SaleOrderController.cls 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ArriveGoodsController.cls
@@ -1028,10 +1028,24 @@
                    }else{
                        Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
                        if(n.find()){
                            String str = '管理编码中有数字,请与管理员确认是否错误。';
                            ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
                            ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                            continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 start
                            if (reSet[i].TracingCode__c.length() == 5) {
                                String tr = reSet[i].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(reSet[i],str));
                                    ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                                    continue;
                                }
                            }
                            // String str = '管理编码中有数字,请与管理员确认是否错误。';
                            // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
                            // ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                            // continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 end
                        }
                        if(otherAgencyMap.containsKey(reSet[i].Bar_Code__c)){
                            for (Integer j=0; j<consumableInventory.size(); j++) {
@@ -1111,11 +1125,24 @@
                        continue;
                    }else{
                        Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
                        if(n.find()){
                            String str = '管理编码中有数字,请与管理员确认是否错误。';
                            ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
                            ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                            continue;
                        if(n.find()){// gzw DB202305352696 入库管理编码验证程序调整 start
                            if (reSet[i].TracingCode__c.length() == 5) {
                                String tr = reSet[i].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(reSet[i],str));
                                    ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                                    continue;
                                }
                            }
                            // String str = '管理编码中有数字,请与管理员确认是否错误。';
                            // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
                            // ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                            // continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 end
                        }
                        ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                        for(String str : barMcodeMap.keySet()){
@@ -1421,10 +1448,24 @@
                    }else{
                        Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
                        if(n.find()){
                            String str = '管理编码中有数字,请与管理员确认是否错误。';
                            ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
                            ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                            continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 start
                            if (reSet[i].TracingCode__c.length() == 5) {
                                String tr = reSet[i].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(reSet[i],str));
                                    ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                                    continue;
                                }
                            }
                            // String str = '管理编码中有数字,请与管理员确认是否错误。';
                            // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
                            // ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                            // continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 end
                        }
                        ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
                        ConsumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(reSet[i]));
@@ -1483,10 +1524,24 @@
                    }else{
                        Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
                        if(n.find()){
                            String str = '管理编码中有数字,请与管理员确认是否错误。';
                            ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
                            ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                            continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 start
                            if (reSet[i].TracingCode__c.length() == 5) {
                                String tr = reSet[i].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(reSet[i],str));
                                    ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                                    continue;
                                }
                            }
                            // String str = '管理编码中有数字,请与管理员确认是否错误。';
                            // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
                            // ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                            // continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 end
                        }
                        ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                        for(String str : barMcodeMap.keySet()){
@@ -1656,9 +1711,22 @@
                            tracingCode = barCodeList[i].substring(barCodeList[i].length() - 5,barCodeList[i].length());
                            Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
                            if(n.find()){
                                String str = '管理编码不正确,请与管理员确认是否错误。';
                                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!'));
                                continue;
                                // gzw DB202305352696 入库管理编码验证程序调整 start
                                if (tracingCode.length() == 5) {
                                    String tr = tracingCode;
                                    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 = '管理编码有误,请检查条形码数据。';
                                        ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码有误,请检查条形码数据。'));
                                        continue;
                                    }
                                }
                                // String str = '管理编码不正确,请与管理员确认是否错误。';
                                // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!'));
                                // continue;
                                // gzw DB202305352696 入库管理编码验证程序调整 end
                            }
                        }else{
                            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的tracingCode错误!'));
@@ -1910,9 +1978,22 @@
                                        tracingCode = bar.substring(bar.length() - 5,bar.length());
                                        Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
                                        if(n.find()){
                                            String str = '管理编码不正确,请与管理员确认是否错误。';
                                            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')管理编码中有数字,请与管理员确认是否错误!'));
                                            continue;
                                            // gzw DB202305352696 入库管理编码验证程序调整 start
                                            if (tracingCode.length() == 5) {
                                                String tr = tracingCode;
                                                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 = '管理编码有误,请检查条形码数据。';
                                                    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')管理编码有误,请检查条形码数据。'));
                                                    continue;
                                                }
                                            }
                                            // String str = '管理编码不正确,请与管理员确认是否错误。';
                                            // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')管理编码中有数字,请与管理员确认是否错误!'));
                                            // continue;
                                            // gzw DB202305352696 入库管理编码验证程序调整 end
                                        }
                                    }else{
                                        ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的tracingCode错误!'));
@@ -2062,9 +2143,22 @@
                        tracingCode = barCodeList[i].substring(barCodeList[i].length() - 5,barCodeList[i].length());
                        Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
                        if(n.find()){
                            String str = '管理编码不正确,请与管理员确认是否错误。';
                            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!'));
                            continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 start
                            if (tracingCode.length() == 5) {
                                String tr = tracingCode;
                                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 = '管理编码有误,请检查条形码数据。';
                                    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码有误,请检查条形码数据。'));
                                    continue;
                                }
                            }
                            // String str = '管理编码不正确,请与管理员确认是否错误。';
                            // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!'));
                            // continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 end
                        }
                    }else{
                        ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的tracingCode错误!'));
@@ -2339,9 +2433,22 @@
                                tracingCode = bar.substring(bar.length() - 5,bar.length());
                                Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
                                if(n.find()){
                                    String str = '管理编码不正确,请与管理员确认是否错误。';
                                    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')管理编码中有数字,请与管理员确认是否错误!'));
                                    continue;
                                    // gzw DB202305352696 入库管理编码验证程序调整 start
                                    if (tracingCode.length() == 5) {
                                        String tr = tracingCode;
                                        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 = '管理编码有误,请检查条形码数据。';
                                            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')管理编码有误,请检查条形码数据。'));
                                            continue;
                                        }
                                    }
                                    // String str = '管理编码不正确,请与管理员确认是否错误。';
                                    // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')管理编码中有数字,请与管理员确认是否错误!'));
                                    // continue;
                                    // gzw DB202305352696 入库管理编码验证程序调整 end
                                }
                            }else{
                                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的tracingCode错误!'));
@@ -3108,10 +3215,24 @@
                Matcher n = Pattern.compile('[0-9]').matcher(codc.TracingCode__c);
                if(n.find()){
                    String str = '管理编码中有数字,请与管理员确认是否错误。';
                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(codc,str));
                    ErrorIdMap.put(codc.Bar_Code__c,codc.Bar_Code__c);
                    continue;
                    // gzw DB202305352696 入库管理编码验证程序调整 start
                            if (codc.TracingCode__c.length() == 5) {
                                String tr = codc.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(codc,str));
                                    ErrorIdMap.put(codc.Bar_Code__c,codc.Bar_Code__c);
                                    continue;
                                }
                            }
                            // String str = '管理编码中有数字,请与管理员确认是否错误。';
                            // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(codc,str));
                            // ErrorIdMap.put(codc.Bar_Code__c,codc.Bar_Code__c);
                            // continue;
                            // gzw DB202305352696 入库管理编码验证程序调整 end
                }
                if( CheckBarcodeResult.containsKey( codc.Bar_Code__c    )){
                    GrList.add(codc.Bar_Code__c);
force-app/main/default/classes/SaleOrderController.cls
@@ -676,10 +676,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]));