|
@@ -2,10 +2,16 @@ package com.fjhx.item.service.product.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.item.entity.product.po.ProductBomDetail;
|
|
|
+import com.fjhx.item.entity.product.vo.ProductBomDetailVo;
|
|
|
import com.fjhx.item.mapper.product.ProductBomDetailMapper;
|
|
|
import com.fjhx.item.service.product.ProductBomDetailService;
|
|
|
+import com.fjhx.item.service.product.ProductInfoService;
|
|
|
+import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -18,4 +24,23 @@ import org.springframework.stereotype.Service;
|
|
|
@Service
|
|
|
public class ProductBomDetailServiceImpl extends ServiceImpl<ProductBomDetailMapper, ProductBomDetail> implements ProductBomDetailService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProductInfoService productInfoService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ProductBomDetailVo> getList(IWrapper<Object> wrapper) {
|
|
|
+ List<ProductBomDetailVo> list = baseMapper.getList(wrapper);
|
|
|
+ productInfoService.attributeAssign(list, ProductBomDetail::getMaterialId, (item, material) -> {
|
|
|
+ item.setMaterialName(material.getName());
|
|
|
+ item.setMaterialCode(material.getCustomCode());
|
|
|
+ item.setMaterialLength(material.getLength());
|
|
|
+ item.setMaterialWidth(material.getWidth());
|
|
|
+ item.setMaterialHeight(material.getHeight());
|
|
|
+ item.setMaterialPrice(material.getPrice());
|
|
|
+ item.setMaterialNetWeight(material.getNetWeight());
|
|
|
+ item.setMaterialColor(material.getColor());
|
|
|
+ item.setMaterialColorCardCode(material.getColorCardCode());
|
|
|
+ });
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|