|
|
@@ -66,6 +66,7 @@ import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.Brand;
|
|
|
import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
|
|
|
import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
|
|
|
+import com.uas.platform.b2c.prod.product.component.dao.ComponentGoodsDao;
|
|
|
import com.uas.platform.b2c.prod.product.component.modal.Component;
|
|
|
import com.uas.platform.b2c.prod.product.kind.dao.KindInfoDao;
|
|
|
import com.uas.platform.b2c.prod.product.kind.model.Kind;
|
|
|
@@ -4139,22 +4140,26 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
List<KindInfo> kindInfos = kindInfoDao.findByParentid(3825L);
|
|
|
if (CollectionUtils.isNotEmpty(kindInfos)) {
|
|
|
for (KindInfo kindInfo : kindInfos) {
|
|
|
- if (kindInfo.getIsLeaf().equals(Constant.YES)) {
|
|
|
- List<Goods> goods = goodsDao.findByKindNameCnAndBrandIsNotNull(kindInfo.getNameCn());
|
|
|
- if (CollectionUtils.isNotEmpty(goods)) {
|
|
|
- map.put(kindInfo.getNameCn(), goods);
|
|
|
- }
|
|
|
- } else {
|
|
|
- List<KindInfo> kindInfoChildren = kindInfoDao.findByParentid(kindInfo.getId());
|
|
|
- if (!CollectionUtils.isEmpty(kindInfoChildren)) {
|
|
|
- List<String> names = new ArrayList<>();
|
|
|
- for (KindInfo child : kindInfoChildren) {
|
|
|
- names.add(child.getNameCn());
|
|
|
+ // 目前仅展示PCB材料、PCB耗材、PCB设备
|
|
|
+ String secondName = kindInfo.getNameCn();
|
|
|
+ if ("PCB材料".equals(secondName) || "PCB耗材".equals(secondName) || "PCB设备".equals(secondName)) {
|
|
|
+ if (kindInfo.getIsLeaf().equals(Constant.YES)) {
|
|
|
+ List<Goods> goods = ComponentGoodsDao goodsDao.findByKindNameCnAndBrandIsNotNull(kindInfo.getNameCn());
|
|
|
+ if (CollectionUtils.isNotEmpty(goods)) {
|
|
|
+ map.put(kindInfo.getNameCn(), goods);
|
|
|
}
|
|
|
- if (CollectionUtils.isNotEmpty(names)) {
|
|
|
- List<Goods> goods = goodsDao.findInKindNamesAndBrandIsNotNull(names);
|
|
|
- if (CollectionUtils.isNotEmpty(goods)) {
|
|
|
- map.put(kindInfo.getNameCn(), goods);
|
|
|
+ } else {
|
|
|
+ List<KindInfo> kindInfoChildren = kindInfoDao.findByParentid(kindInfo.getId());
|
|
|
+ if (!CollectionUtils.isEmpty(kindInfoChildren)) {
|
|
|
+ List<String> names = new ArrayList<>();
|
|
|
+ for (KindInfo child : kindInfoChildren) {
|
|
|
+ names.add(child.getNameCn());
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isNotEmpty(names)) {
|
|
|
+ List<Goods> goods = goodsDao.findInKindNamesAndBrandIsNotNull(names);
|
|
|
+ if (CollectionUtils.isNotEmpty(goods)) {
|
|
|
+ map.put(kindInfo.getNameCn(), goods);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|