|
|
@@ -123,23 +123,6 @@ public class ProductServiceImpl implements ProductService {
|
|
|
return product;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public Product updateMall(Product productInfo, Product product) {
|
|
|
- if (!StringUtils.isEmpty(productInfo.getSpec())) {
|
|
|
- product.setSpec(productInfo.getSpec());
|
|
|
- }
|
|
|
- String newkind = productInfo.getKind();
|
|
|
- if (!StringUtils.isEmpty(newkind)) {
|
|
|
- if (Constant.YES == product.getStandard()) {
|
|
|
- product.setTitle(newkind);
|
|
|
- } else {
|
|
|
- product.setKind(newkind);
|
|
|
- product.setTitle(newkind);
|
|
|
- }
|
|
|
- }
|
|
|
- return productDao.save(product);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public List<Product> save(List<Product> products) {
|
|
|
List<ProductPrivate> savePrivateList = new ArrayList<>();
|
|
|
@@ -159,6 +142,23 @@ public class ProductServiceImpl implements ProductService {
|
|
|
return prodList;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Product updateMall(Product productInfo, Product product) {
|
|
|
+ if (!StringUtils.isEmpty(productInfo.getSpec())) {
|
|
|
+ product.setSpec(productInfo.getSpec());
|
|
|
+ }
|
|
|
+ String newkind = productInfo.getKind();
|
|
|
+ if (!StringUtils.isEmpty(newkind)) {
|
|
|
+ if (Constant.YES == product.getStandard()) {
|
|
|
+ product.setTitle(newkind);
|
|
|
+ } else {
|
|
|
+ product.setKind(newkind);
|
|
|
+ product.setTitle(newkind);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return productDao.save(product);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Product> convertProduct(List<Prod> prods, Long enUU) {
|
|
|
List<Product> products = new ArrayList<Product>();
|
|
|
@@ -178,6 +178,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
if (!StringUtils.isEmpty(existProduct.getKind()) && Constant.YES == existProduct.getStandard()) {
|
|
|
product.setKind(existProduct.getKind());
|
|
|
}
|
|
|
+ // 将创建时间保留或补全
|
|
|
+ product.setCreateTime(existProduct.getCreateTime() != null ? existProduct.getCreateTime() : new Date());
|
|
|
product.setId(existProduct.getId());
|
|
|
product.setCode(existProduct.getCode());
|
|
|
products.add(product);
|
|
|
@@ -203,6 +205,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
if (!StringUtils.isEmpty(existProduct.getKind()) && Constant.YES == existProduct.getStandard()) {
|
|
|
product.setKind(existProduct.getKind());
|
|
|
}
|
|
|
+ // 将创建时间保留或补全
|
|
|
+ product.setCreateTime(existProduct.getCreateTime() != null ? existProduct.getCreateTime() : new Date());
|
|
|
product.setId(prodResult.get(0).getId());
|
|
|
product.setCode(prodResult.get(0).getCode());
|
|
|
return product;
|
|
|
@@ -316,6 +320,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
if (!StringUtils.isEmpty(product.getTitle()) && Constant.NO == existedProd.getStandard()) {
|
|
|
existedProd.setKind(product.getTitle());
|
|
|
}
|
|
|
+ // 将创建时间保留或补全
|
|
|
existedProd.setCmpCode(product.getCmpCode());
|
|
|
existedProd.setUnit(product.getUnit());
|
|
|
existedProd.setBrand(product.getBrand());
|