| | |
| | | //判断当前出库单是否为医院特价出库单 |
| | | if (coc.OutPattern__c == true) { |
| | | if (newdet2[j].Product_Pattern__c == orderdetails[i].Product_Pattern__c) { |
| | | |
| | | if (hpList != null && hpList.size() > 0) { |
| | | //add by rentx 2021-03-22 start |
| | | if (newdet2[j].exchangeOutPattern__c || coc.SummonsForDirction__c == '互相调货') { |
| | | //如果当前经销商下没有维护对应的特价产品 报错 |
| | | if (!proIdMap.containsKey(newdet2[j].Product_Pattern__c)) { |
| | | String str = '没有维护该产品的特价医院'; |
| | | consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j],str)); |
| | | errorIdMap.put(newdet2[j].Bar_Code__c,newdet2[j].Bar_Code__c); |
| | | } |
| | | }else{ |
| | | if (proHosMap.containsKey(newdet2[j].Product_Pattern__c)) { |
| | | continue; |
| | | }else if (!proIdMap.containsKey(newdet2[j].Product_Pattern__c)) { |
| | | continue; |
| | | }else{ |
| | | String str = '该商品出库医院错误'; |
| | | consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j],str)); |
| | | errorIdMap.put(newdet2[j].Bar_Code__c,newdet2[j].Bar_Code__c); |
| | | } |
| | | //add by rentx 2021-03-22 start |
| | | if (newdet2[j].exchangeOutPattern__c == true) { |
| | | //如果当前经销商下没有维护对应的特价产品 报错 |
| | | if (!proIdMap.containsKey(newdet2[j].Product_Pattern__c)) { |
| | | String str = '没有维护该产品的特价医院'; |
| | | consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j],str)); |
| | | errorIdMap.put(newdet2[j].Bar_Code__c,newdet2[j].Bar_Code__c); |
| | | } |
| | | //add by rentx 2021-03-22 end |
| | | } |
| | | //add by rentx 2021-03-22 end |
| | | |
| | | |
| | | |
| | | if (hpList != null && hpList.size() > 0) { |
| | | if (proHosMap.containsKey(newdet2[j].Product_Pattern__c)) { |
| | | continue; |
| | | }else if (!proIdMap.containsKey(newdet2[j].Product_Pattern__c)) { |
| | | continue; |
| | | }else{ |
| | | String str = '该商品出库医院错误'; |
| | | consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j],str)); |
| | | errorIdMap.put(newdet2[j].Bar_Code__c,newdet2[j].Bar_Code__c); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | }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])); |