Commit f5667298 authored by 覃振观's avatar 覃振观 👶

Entity 遗漏

parent 3bbc22a0
...@@ -80,7 +80,7 @@ public class ProductApplicationImpl implements ProductApplication { ...@@ -80,7 +80,7 @@ public class ProductApplicationImpl implements ProductApplication {
@Override @Override
public Map<String, Object> queryDetailAll(Product product) { public Map<String, Object> queryDetailAll(Product product) {
Map<String, Object> resultMap = new HashMap<>(200); Map<String, Object> resultMap = new HashMap<>(200);
BigDecimal productId = product.getProductId(); String productId = product.getProductId();
ProductDetail productDetail = detailRepository.findByProductId(productId); ProductDetail productDetail = detailRepository.findByProductId(productId);
ProductTechnology productTechnology = technologyRepository.findByProductId(productId); ProductTechnology productTechnology = technologyRepository.findByProductId(productId);
...@@ -181,7 +181,7 @@ public class ProductApplicationImpl implements ProductApplication { ...@@ -181,7 +181,7 @@ public class ProductApplicationImpl implements ProductApplication {
List<Product> products = query.getResultList(); List<Product> products = query.getResultList();
if(product != null) { if(product != null) {
BigDecimal id = product.getProductId(); String id = product.getProductId();
if(id == null) { if(id == null) {
product.setProductId(String.valueOf(Snowflake.nextId())); product.setProductId(String.valueOf(Snowflake.nextId()));
entityManager.persist(product); entityManager.persist(product);
...@@ -189,7 +189,7 @@ public class ProductApplicationImpl implements ProductApplication { ...@@ -189,7 +189,7 @@ public class ProductApplicationImpl implements ProductApplication {
entityManager.merge(product); entityManager.merge(product);
} }
if(productDetail != null) { if(productDetail != null) {
BigDecimal id = productDetail.getProductDetailId(); String id = productDetail.getProductDetailId();
if(id == null) { if(id == null) {
productDetail.setProductDetailId(String.valueOf(Snowflake.nextId())); productDetail.setProductDetailId(String.valueOf(Snowflake.nextId()));
entityManager.persist(productDetail); entityManager.persist(productDetail);
...@@ -197,7 +197,7 @@ public class ProductApplicationImpl implements ProductApplication { ...@@ -197,7 +197,7 @@ public class ProductApplicationImpl implements ProductApplication {
entityManager.merge(productDetail); entityManager.merge(productDetail);
} }
if(productLooked != null) { if(productLooked != null) {
BigDecimal id = productLooked.getProductLookedId(); String id = productLooked.getProductLookedId();
if(id == null) { if(id == null) {
productLooked.setProductLookedId(String.valueOf(Snowflake.nextId())); productLooked.setProductLookedId(String.valueOf(Snowflake.nextId()));
entityManager.persist(productLooked); entityManager.persist(productLooked);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment