|
|
|
@ -47,17 +47,15 @@ public final class BarcodeParseUtil {
|
|
|
|
|
String[] barcodeKey = barcodeRule.getBarcodeRule().split(barcodeRule.getBarcodeSeparator());
|
|
|
|
|
String[] barcodeValue = barcode.split(barcodeRule.getBarcodeSeparator());
|
|
|
|
|
|
|
|
|
|
// 避免出现长度不相等
|
|
|
|
|
int size = barcodeKey.length;
|
|
|
|
|
if (barcodeKey.length != barcodeValue.length) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("条码与规则不匹配!")
|
|
|
|
|
.build();
|
|
|
|
|
size = Math.min(barcodeKey.length,barcodeValue.length);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 匹配条码数据
|
|
|
|
|
HashMap<String, String> barcodeMap = new HashMap<>();
|
|
|
|
|
for (int i = 0; i < barcodeKey.length; i++) {
|
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
|
barcodeMap.put(barcodeKey[i], barcodeValue[i]);
|
|
|
|
|
}
|
|
|
|
|
return barcodeMap;
|
|
|
|
|