|
@@ -24,10 +24,7 @@ import org.redisson.misc.Hash;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -130,8 +127,14 @@ public class MaterialServiceImpl implements MaterialService {
|
|
|
BaseMaterial material = baseMaterialMapper.selectById(req.getId());
|
|
|
AssertUtil.isNull(material, "物料不存在");
|
|
|
|
|
|
+ //2-查询父类品牌(前台需要)
|
|
|
+ BaseBrand parentBrand = getBrand(material.getBrandCode());
|
|
|
+ String parentBrandCode = parentBrand.getParentBrandCode();
|
|
|
+ List<String> brandCodeList = Arrays.asList(parentBrandCode, material.getBrandCode());
|
|
|
+
|
|
|
//转化出参
|
|
|
GetMaterialRes res = PojoConverterUtils.copy(material, GetMaterialRes.class);
|
|
|
+ res.setBrandCodeList(brandCodeList);
|
|
|
|
|
|
return res;
|
|
|
|
|
@@ -183,6 +186,21 @@ public class MaterialServiceImpl implements MaterialService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询品牌信息
|
|
|
+ * @param brandCode
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private BaseBrand getBrand(String brandCode){
|
|
|
+ QueryWrapper<BaseBrand> brandQw = new QueryWrapper<>();
|
|
|
+ brandQw.eq("brand_code",brandCode);
|
|
|
+ brandQw.eq("is_delete",0);
|
|
|
+ BaseBrand baseBrand = baseBrandMapper.selectOne(brandQw);
|
|
|
+ AssertUtil.isNull(baseBrand,"品牌不存在");
|
|
|
+
|
|
|
+ return baseBrand;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 下拉选择物料列表
|
|
|
**/
|