diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/document/OutMaterialScanRecord.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/document/OutMaterialScanRecord.java index bec7fa6c..ddfae7b2 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/document/OutMaterialScanRecord.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/document/OutMaterialScanRecord.java @@ -9,6 +9,7 @@ import org.springframework.data.mongodb.core.mapping.Document; import java.math.BigDecimal; import java.time.Instant; +import java.util.Objects; @Data @Accessors(chain = true) @@ -43,11 +44,19 @@ public class OutMaterialScanRecord { */ private String batchNo; + public String getBatchNo() { + return Objects.isNull(batchNo) ? "" : batchNo; + } + /** * 序列号 */ private String serialNo; + public String getSerialNo() { + return Objects.isNull(serialNo) ? "" : serialNo; + } + /** * 工厂编号 */ @@ -63,6 +72,10 @@ public class OutMaterialScanRecord { */ private String binNo; + public String getBinNo() { + return Objects.isNull(binNo) ? "" : binNo; + } + /** * 数量 */ @@ -125,62 +138,62 @@ public class OutMaterialScanRecord { private String key; public String getKey() { - return this.materialNo + "|" + this.batchNo + "|" + this.serialNo + "|" + this.factoryNo + "|" + this.warehouseNo; + return this.materialNo + "|" + this.getBatchNo() + "|" + this.getSerialNo() + "|" + this.factoryNo + "|" + this.warehouseNo; } @Transient private String key1; public String getKey1() { - return this.materialNo + "|" + this.serialNo; + return this.materialNo + "|" + this.getSerialNo(); } @Transient private String key3; public String getKey3() { - return this.serialNo + "|" + this.ext; + return this.getSerialNo() + "|" + this.ext; } @Transient private String key4; public String getKey4() { - return ebelp + "|" + this.materialNo + "|" + this.batchNo; + return ebelp + "|" + this.materialNo + "|" + this.getBatchNo(); } @Transient private String key5; public String getKey5() { - return this.ebelp + "|" + this.serialNo; + return this.ebelp + "|" + this.getSerialNo(); } @Transient private String key6; public String getKey6() { - return this.rspos + "|" + this.serialNo; + return this.rspos + "|" + this.getSerialNo(); } @Transient private String key7; public String getKey7() { - return materialNo + "|" + batchNo; + return materialNo + "|" + getBatchNo(); } @Transient private String key8; public String getKey8() { - return materialNo + "|" + batchNo + "|" + this.serialNo; + return materialNo + "|" + getBatchNo() + "|" + this.getSerialNo(); } @Transient private String key9; public String getKey9() { - return materialNo + "|" + batchNo + "|" + this.serialNo + "|" + this.binNo; + return materialNo + "|" + getBatchNo() + "|" + this.getSerialNo() + "|" + this.getBinNo(); } }