|
|
|
@ -177,7 +177,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) {
|
|
|
|
@ -190,6 +192,10 @@ public class FilterUdiUtils {
|
|
|
|
|
udiEntity.setSerialNo(entry.getValue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (data.length() - length > 12) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isEmpty(udiEntity.getUdi())) {
|
|
|
|
|
return null;
|
|
|
|
|
} else
|
|
|
|
@ -298,11 +304,13 @@ public class FilterUdiUtils {
|
|
|
|
|
}
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String transGlxpNoSerStr(WarehouseEntity warehouseEntity) {
|
|
|
|
|
String udiCode = "#" + warehouseEntity.getNameCode() + "#" + warehouseEntity.getProduceDate() + "#" + warehouseEntity.getExpireDate() +
|
|
|
|
|
"#" + warehouseEntity.getBatchNo() + "#" + "#" + "#";
|
|
|
|
|
return udiCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String transGlxpNoSerStr(UdiEntity warehouseEntity) {
|
|
|
|
|
String udiCode = "#" + warehouseEntity.getUdi() + "#" + warehouseEntity.getProduceDate() + "#" + warehouseEntity.getExpireDate() +
|
|
|
|
|
"#" + warehouseEntity.getBatchNo() + "#" + "#" + "#";
|
|
|
|
|