|
|
|
@ -35,6 +35,11 @@ public class BarcodeParseUtil {
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//特殊分隔符处理
|
|
|
|
|
barcodeRule.setBarcodeSeparator(barcodeRule.getBarcodeSeparator().replaceAll("\\|","\\\\|"));
|
|
|
|
|
barcodeRule.setBarcodeSeparator(barcodeRule.getBarcodeSeparator().replaceAll("\\.","\\\\."));
|
|
|
|
|
barcodeRule.setBarcodeSeparator(barcodeRule.getBarcodeSeparator().replaceAll("\\\\","\\\\\\\\"));
|
|
|
|
|
|
|
|
|
|
// 分隔条码信息
|
|
|
|
|
String[] barcodeKey = barcodeRule.getBarcodeRule().split(barcodeRule.getBarcodeSeparator());
|
|
|
|
|
String[] barcodeValue = barcode.split(barcodeRule.getBarcodeSeparator());
|
|
|
|
@ -59,11 +64,11 @@ public class BarcodeParseUtil {
|
|
|
|
|
SysBarcodeRule barcodeRule = new SysBarcodeRule();
|
|
|
|
|
barcodeRule.setName("测试条码规则");
|
|
|
|
|
barcodeRule.setBarcodeRuleCode("Barcode");
|
|
|
|
|
barcodeRule.setBarcodeRule("orderNo/groupId/num");
|
|
|
|
|
barcodeRule.setBarcodeSeparator("/");
|
|
|
|
|
barcodeRule.setBarcodeRule("SN\\ORGANIZE_CODE\\PART_NO\\QTY\\UNIT");
|
|
|
|
|
barcodeRule.setBarcodeSeparator("\\");
|
|
|
|
|
barcodeRule.setBarcodeRuleDescription("描述");
|
|
|
|
|
|
|
|
|
|
Map barcode= parse(barcodeRule,"99/99/99");
|
|
|
|
|
Map barcode= parse(barcodeRule,"99\\99\\99\\99\\99");
|
|
|
|
|
|
|
|
|
|
System.out.println(barcode);
|
|
|
|
|
}
|
|
|
|
|