| | |
| | | import com.ruoyi.framework.util.AliDingUtils; |
| | | import com.ruoyi.production.dto.ProductMaterialDto; |
| | | import com.ruoyi.production.dto.ProductMaterialGroupDto; |
| | | import com.ruoyi.production.dto.ProductMaterialSkuDto; |
| | | import com.ruoyi.production.enums.MaterialConfigTypeEnum; |
| | | import com.ruoyi.production.mapper.ProductMaterialMapper; |
| | | import com.ruoyi.production.pojo.ProductMaterial; |
| | |
| | | @Override |
| | | public List<ProductMaterialGroupDto> ProductMaterialList(Integer type) { |
| | | List<ProductMaterialConfig> configList = productMaterialConfigService.list(new LambdaQueryWrapper<ProductMaterialConfig>() |
| | | .eq(ProductMaterialConfig::getConfigType, MaterialConfigTypeEnum.MATERIAL_TYPE.name()) |
| | | ); |
| | | .eq(ProductMaterialConfig::getConfigType, MaterialConfigTypeEnum.MATERIAL_TYPE.name())); |
| | | if (CollectionUtils.isEmpty(configList)) { |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | ProductMaterial::getId, |
| | | ProductMaterial::getMaterialTypeId, |
| | | ProductMaterial::getInventoryCategoryId, |
| | | ProductMaterial::getProductName |
| | | ProductMaterial::getProductName, |
| | | ProductMaterial::getUnit, |
| | | ProductMaterial::getRemark |
| | | ) |
| | | ); |
| | | materialMap = materialList.stream() |
| | |
| | | dto.setProductName(m.getProductName()); |
| | | dto.setMaterialTypeId(m.getMaterialTypeId()); |
| | | dto.setInventoryCategoryId(m.getInventoryCategoryId()); |
| | | dto.setUnit(m.getUnit()); |
| | | dto.setRemark(m.getRemark()); |
| | | return dto; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String selectProductModelIdByName(Long productId) { |
| | | return baseMapper.selectProductModelIdByName(productId); |
| | | public ProductMaterialSkuDto selectProductByModelId(Long productModelId) { |
| | | return baseMapper.selectProductByModelId(productModelId); |
| | | } |
| | | |
| | | @Override |
| | | public ProductMaterialSkuDto selectProductByProductMainId(Long productOrderId) { |
| | | return baseMapper.selectProductByProductMainId(productOrderId); |
| | | } |
| | | |
| | | private void validateProductMaterial(ProductMaterial productMaterial, boolean requireId) { |