|
@@ -12,6 +12,7 @@ import com.fjhx.item.service.product.ProductBomDetailService;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
|
import com.ruoyi.common.core.domain.BaseSelectDto;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -50,9 +51,10 @@ public class ProductBomInfoController {
|
|
|
Assert.notEmpty(productInfo, "查询不到产品信息");
|
|
|
|
|
|
//赋值物料信息
|
|
|
- List<ProductBomDetail> list = productBomDetailService.list(q -> q
|
|
|
- .eq(ProductBomDetail::getProductId, dto.getId())
|
|
|
- .orderByAsc(ProductBomDetail::getType)
|
|
|
+ List<ProductBomDetailVo> list = productBomDetailService.getList(IWrapper.getWrapper()
|
|
|
+ .eq("pbd", ProductBomDetail::getProductId, dto.getId())
|
|
|
+ .orderByAsc("FIELD( pbd.type, 1, 3, 2 )")
|
|
|
+ .orderByAsc("pbd.id")
|
|
|
);
|
|
|
List<ProductBomDetailVo> productBomDetailVos = BeanUtil.copyToList(list, ProductBomDetailVo.class);
|
|
|
productInfoService.attributeAssign(productBomDetailVos, ProductBomDetail::getMaterialId, (item, material) -> {
|