Browse Source

fix(批量导入及上架):处理导入产品及上架时选择覆盖导入时 物料名称和成本单价没有覆盖的问题。

yuj 6 năm trước cách đây
mục cha
commit
b0f5e50247

+ 15 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -435,6 +435,12 @@ public class ReleaseProductByBatch implements Serializable {
 	@Column(name = "rel_b2ckindname")
 	private String kindName = "";
 
+	/**
+	 * 物料名称
+	 */
+	@Column(name = "rel_title")
+	private String title;
+
 	/**
 	 * 类目ID
 	 */
@@ -604,6 +610,7 @@ public class ReleaseProductByBatch implements Serializable {
 			}
 		}
 		setKindName(StringUtilB2C.getStr(value));
+		setTitle(getKindName());
 	}
 
 	public void setCodeByExcel(Object value) {
@@ -1773,6 +1780,14 @@ public class ReleaseProductByBatch implements Serializable {
 		return this;
 	}
 
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
 	@Override
 	public String toString() {
 		return "ReleaseProductByBatch{" +

+ 5 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -2312,13 +2312,15 @@ public class ProductServiceImpl implements ProductService {
                     if ((product.getMinPackQty() == null) || (ignoreImport == IntegerConstant.NO_SHORT)) {
                         product.setMinPackQty(productByBatch.getMinPackage());
                     }
-                    if ((product.getKind() == null)  || (ignoreImport == IntegerConstant.NO_SHORT)) {
-                        product.setKind(productByBatch.getKindName());
-                        product.setKindid(productByBatch.getKindUuid());
+                    if ((product.getKind() == null)  || (ignoreImport == IntegerConstant.NO_SHORT && product.getStandard().intValue() == IntegerConstant.NO_SHORT)) {
+                        product.setKind(productByBatch.getTitle());
                     }
                     if (StringUtils.isEmpty(product.getSpec()) || (ignoreImport == IntegerConstant.NO_SHORT)) {
                         product.setSpec(productByBatch.getSpec());
                     }
+                    if (StringUtils.isEmpty(product.getPrice()) || (ignoreImport == IntegerConstant.NO_SHORT)) {
+                        product.setPrice(productByBatch.getCostPrice());
+                    }
                     if ((Objects.equals(ignoreImport, IntegerConstant.NO_SHORT)) || (NumberUtil.compare(product.getErpReserve(), productByBatch.getReserve()) != 0)) {
                         Double qty = NumberUtil.sub(productByBatch.getReserve(), product.getErpReserve());
                         if (NumberUtil.compare(qty, DoubleConstant.zero) != 0) {