pi中的goodlist不做状态和库存的过滤
Showing
3 changed files
with
14 additions
and
4 deletions
@@ -159,6 +159,13 @@ public class GoodsMqListener extends AbstractMqListener implements ChannelAwareM | @@ -159,6 +159,13 @@ public class GoodsMqListener extends AbstractMqListener implements ChannelAwareM | ||
159 | JSONArray goodsListJsonArray = JSONArray.parseArray(goodsListJsonArrayStr); | 159 | JSONArray goodsListJsonArray = JSONArray.parseArray(goodsListJsonArrayStr); |
160 | for (int i = 0; i < goodsListJsonArray.size(); i++) { | 160 | for (int i = 0; i < goodsListJsonArray.size(); i++) { |
161 | JSONObject jsonObject = goodsListJsonArray.getJSONObject(i); | 161 | JSONObject jsonObject = goodsListJsonArray.getJSONObject(i); |
162 | + //去除无库存和非正常状态的 | ||
163 | + if (!jsonObject.containsKey("status")||!jsonObject.get("status").toString().equals("1")) { | ||
164 | + continue; | ||
165 | + } | ||
166 | + if (!jsonObject.containsKey("storage_num")||((Integer)jsonObject.get("storage_num"))<1) { | ||
167 | + continue; | ||
168 | + } | ||
162 | if (jsonObject.containsKey("color_id")) { | 169 | if (jsonObject.containsKey("color_id")) { |
163 | colorIdSet.add(jsonObject.get("color_id").toString()); | 170 | colorIdSet.add(jsonObject.get("color_id").toString()); |
164 | } | 171 | } |
@@ -93,10 +93,6 @@ public class ProductGoodsLogicService { | @@ -93,10 +93,6 @@ public class ProductGoodsLogicService { | ||
93 | // 构造product_good视图 | 93 | // 构造product_good视图 |
94 | List<ProductGoodBO> productGoodBOs = new ArrayList<>(); | 94 | List<ProductGoodBO> productGoodBOs = new ArrayList<>(); |
95 | for (Goods g : goodss) { | 95 | for (Goods g : goodss) { |
96 | - //去除无库存和非正常状态的 | ||
97 | - if(storagesMap.get(g.getId()) == null || storagesMap.get(g.getId()) == 0 || 1 != g.getStatus()){ | ||
98 | - continue; | ||
99 | - } | ||
100 | ProductGoodBO productGoodBO = new ProductGoodBO(); | 96 | ProductGoodBO productGoodBO = new ProductGoodBO(); |
101 | productGoodBO.setProduct_id(g.getProductId()); | 97 | productGoodBO.setProduct_id(g.getProductId()); |
102 | productGoodBO.setIsDefault(g.getIsDefault() == null ? "" : g.getIsDefault()); | 98 | productGoodBO.setIsDefault(g.getIsDefault() == null ? "" : g.getIsDefault()); |
@@ -46,6 +46,13 @@ public class ProductGoodsBuilder implements ViewBuilder{ | @@ -46,6 +46,13 @@ public class ProductGoodsBuilder implements ViewBuilder{ | ||
46 | colorNameSet = new HashSet<String>(); | 46 | colorNameSet = new HashSet<String>(); |
47 | for (int i = 0; i < goodsListJsonArray.size(); i++) { | 47 | for (int i = 0; i < goodsListJsonArray.size(); i++) { |
48 | JSONObject jsonObject = goodsListJsonArray.getJSONObject(i); | 48 | JSONObject jsonObject = goodsListJsonArray.getJSONObject(i); |
49 | + //去除无库存和非正常状态的 | ||
50 | + if (!jsonObject.containsKey("status")||!jsonObject.get("status").toString().equals("1")) { | ||
51 | + continue; | ||
52 | + } | ||
53 | + if (!jsonObject.containsKey("storage_num")||((Integer)jsonObject.get("storage_num"))<1) { | ||
54 | + continue; | ||
55 | + } | ||
49 | if (jsonObject.containsKey("color_id")) { | 56 | if (jsonObject.containsKey("color_id")) { |
50 | colorIdSet.add(jsonObject.get("color_id").toString()); | 57 | colorIdSet.add(jsonObject.get("color_id").toString()); |
51 | } | 58 | } |
-
Please register or login to post a comment