Authored by gemingdan

pi中的goodlist不做状态和库存的过滤

... ... @@ -159,6 +159,13 @@ public class GoodsMqListener extends AbstractMqListener implements ChannelAwareM
JSONArray goodsListJsonArray = JSONArray.parseArray(goodsListJsonArrayStr);
for (int i = 0; i < goodsListJsonArray.size(); i++) {
JSONObject jsonObject = goodsListJsonArray.getJSONObject(i);
//去除无库存和非正常状态的
if (!jsonObject.containsKey("status")||!jsonObject.get("status").toString().equals("1")) {
continue;
}
if (!jsonObject.containsKey("storage_num")||((Integer)jsonObject.get("storage_num"))<1) {
continue;
}
if (jsonObject.containsKey("color_id")) {
colorIdSet.add(jsonObject.get("color_id").toString());
}
... ...
... ... @@ -93,10 +93,6 @@ public class ProductGoodsLogicService {
// 构造product_good视图
List<ProductGoodBO> productGoodBOs = new ArrayList<>();
for (Goods g : goodss) {
//去除无库存和非正常状态的
if(storagesMap.get(g.getId()) == null || storagesMap.get(g.getId()) == 0 || 1 != g.getStatus()){
continue;
}
ProductGoodBO productGoodBO = new ProductGoodBO();
productGoodBO.setProduct_id(g.getProductId());
productGoodBO.setIsDefault(g.getIsDefault() == null ? "" : g.getIsDefault());
... ...
... ... @@ -46,6 +46,13 @@ public class ProductGoodsBuilder implements ViewBuilder{
colorNameSet = new HashSet<String>();
for (int i = 0; i < goodsListJsonArray.size(); i++) {
JSONObject jsonObject = goodsListJsonArray.getJSONObject(i);
//去除无库存和非正常状态的
if (!jsonObject.containsKey("status")||!jsonObject.get("status").toString().equals("1")) {
continue;
}
if (!jsonObject.containsKey("storage_num")||((Integer)jsonObject.get("storage_num"))<1) {
continue;
}
if (jsonObject.containsKey("color_id")) {
colorIdSet.add(jsonObject.get("color_id").toString());
}
... ...