UDI码解析问题

busUser
anthonywj 2 years ago
parent 3b1a3b05f9
commit 4cf3d32e52

@ -38,7 +38,9 @@ public class FilterUdiUtils {
Gs1128Decoder decoder = engine.decoder();
Map<AI, String> result = decoder.decode("]C1" + data);
UdiEntity udiEntity = new UdiEntity();
int length = 0;
for (Map.Entry<AI, String> entry : result.entrySet()) {
length = length + entry.getValue().length();
if (entry.getKey() == AIs.GTIN) {
udiEntity.setUdi(entry.getValue());
} else if (entry.getKey() == AIs.BATCH_LOT) {
@ -51,6 +53,10 @@ public class FilterUdiUtils {
udiEntity.setSerialNo(entry.getValue());
}
}
if (data.length() - length > 10) {
return null;
}
if (StrUtil.isEmpty(udiEntity.getUdi())) {
return null;
} else

Loading…
Cancel
Save