|
|
@@ -6,13 +6,15 @@ import com.uas.platform.b2c.prod.product.kind.model.KindInfo;
|
|
|
import com.uas.platform.b2c.prod.product.kind.service.KindService;
|
|
|
import com.uas.platform.b2c.prod.store.facade.CommodityFacade;
|
|
|
import com.uas.platform.b2c.prod.store.service.CommodityService;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.LinkedHashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
-import java.util.*;
|
|
|
-
|
|
|
/**
|
|
|
* 商品外观实现类
|
|
|
*
|
|
|
@@ -49,6 +51,10 @@ public class CommodityFacadeImpl implements CommodityFacade {
|
|
|
children.addAll(kindList);
|
|
|
}
|
|
|
}
|
|
|
+ // 补充该店铺各类目下商品数量
|
|
|
+ for (KindInfo kindInfo : children) {
|
|
|
+ kindInfo.setCount(commodityService.CountCommodityByKindAndStore(kindInfo.getId(), storeUuid));
|
|
|
+ }
|
|
|
int count = goodsService.getNonstandardGoodsCount(storeUuid); //有效的在售非标数
|
|
|
if (!sysConf.getStoreid().equals(storeUuid)) {
|
|
|
Long enUU = goodsService.findenUUByStoreid(storeUuid);
|
|
|
@@ -61,7 +67,9 @@ public class CommodityFacadeImpl implements CommodityFacade {
|
|
|
}
|
|
|
}
|
|
|
if (count != 0){ //存在非标则添加其他类目
|
|
|
- children.add(KindInfo.getOtherKind());
|
|
|
+ KindInfo kindInfo = KindInfo.getOtherKind();
|
|
|
+ kindInfo.setCount(count);
|
|
|
+ children.add(kindInfo);
|
|
|
}
|
|
|
allKind.setChildren(children);
|
|
|
return Collections.singletonList(allKind);
|