Эх сурвалжийг харах

产品价格 产品分类树处理

yzc 1 жил өмнө
parent
commit
0c8816c3ba

+ 1 - 1
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductClassifyServiceImpl.java

@@ -49,7 +49,7 @@ public class ProductClassifyServiceImpl extends ServiceImpl<ProductClassifyMappe
         }
 
         List<ProductClassify> list = lambdaQuery()
-                .select(ProductClassify::getId, ProductClassify::getName, ProductClassify::getParentId, ProductClassify::getSort)
+                .select(ProductClassify::getId, ProductClassify::getName, ProductClassify::getParentId, ProductClassify::getSort, ProductClassify::getParentIdSet)
                 .eq(ProductClassify::getDefinition, productClassify.getDefinition())
                 .like(ObjectUtil.isNotEmpty(name), ProductClassify::getName, name)
                 .notIn(ObjectUtil.isNotEmpty(pcIds), ProductClassify::getId, pcIds)

+ 2 - 2
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -310,7 +310,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
 
         for (ProductBomDetail productBomDetail : productBomDetailList) {
             ProductInfo materialInfo = this.getById(productBomDetail.getMaterialId());
-            if (ObjectUtil.equals(materialInfo.getClass(), 100)) {
+            if (ObjectUtil.equals(productBomDetail.getType(), 1)) {
                 //原材料 产品长 * 产品宽 * 原材料单价
                 BigDecimal multiply = length.multiply(width).multiply(materialInfo.getPrice());
                 materialPrice = materialPrice.add(multiply);
@@ -347,7 +347,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
             for (ProductBomDetail productBomDetail : productBomDetailList) {
                 ProductInfo productInfo = this.getById(productBomDetail.getProductId());
 
-                if (ObjectUtil.equals(materialInfo.getClass(), 100)) {
+                if (ObjectUtil.equals(productBomDetail.getType(), 1)) {
                     oldPrice = productInfo.getLength().multiply(productInfo.getWidth()).multiply(oldPrice);
                     newPrice = productInfo.getLength().multiply(productInfo.getWidth()).multiply(newPrice);
                 } else {