Commit 8eb4085f by yu.sun

sunyu::update::fix bug about specialAttribute copyOrder

parents 0aa176cf 13a1533f
...@@ -866,9 +866,9 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -866,9 +866,9 @@ public class ShoppingCartMCoffeeServiceImpl {
JSONArray specialAttrs = JSONArray.parseArray(extJson.getString("specialAttrs")); JSONArray specialAttrs = JSONArray.parseArray(extJson.getString("specialAttrs"));
for (Object specialAttr : specialAttrs) { for (Object specialAttr : specialAttrs) {
JSONObject object = JSONObject.parseObject(specialAttr.toString()); JSONObject object = JSONObject.parseObject(specialAttr.toString());
specialExtra.setAttributeId(extJson.containsKey("attributeId") ? extJson.getString("attributeId") : ""); specialExtra.setAttributeId(object.containsKey("attributeId") ? object.getString("attributeId") : "");
specialExtra.setAttributeName(extJson.containsKey("attributeName") ? extJson.getString("attributeName") : ""); specialExtra.setAttributeName(object.containsKey("attributeName") ? object.getString("attributeName") : "");
specialExtra.setAttributeId(extJson.containsKey("specialCode") ? extJson.getString("specialCode") : ""); specialExtra.setAttributeId(object.containsKey("specialCode") ? object.getString("specialCode") : "");
} }
cartGoods.setSpecialExtra(Arrays.asList(specialExtra)); cartGoods.setSpecialExtra(Arrays.asList(specialExtra));
} }
...@@ -896,6 +896,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -896,6 +896,7 @@ public class ShoppingCartMCoffeeServiceImpl {
comboxGoods.setOriginalPrice(orderItemResp.getProductPrice().longValue()); comboxGoods.setOriginalPrice(orderItemResp.getProductPrice().longValue());
comboxGoods.setFinalPrice(orderItemResp.getSalePrice().longValue()); comboxGoods.setFinalPrice(orderItemResp.getSalePrice().longValue());
comboxGoods.setPic(orderItemResp.getProductPicUrl()); comboxGoods.setPic(orderItemResp.getProductPicUrl());
comboxGoods.setName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :""); comboxGoods.setName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :"");
comboxGoods.setSpuName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :""); comboxGoods.setSpuName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :"");
comboxGoods.setSkuName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() :""); comboxGoods.setSkuName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() :"");
...@@ -912,6 +913,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -912,6 +913,7 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
comboxGoods.setExtra(extra); comboxGoods.setExtra(extra);
} }
for (OrderItemResp itemResp : orderItemList) { for (OrderItemResp itemResp : orderItemList) {
//特制 //特制
if (StringUtils.isNotEmpty(itemResp.getExtInfo())){ if (StringUtils.isNotEmpty(itemResp.getExtInfo())){
...@@ -921,11 +923,11 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -921,11 +923,11 @@ public class ShoppingCartMCoffeeServiceImpl {
JSONArray specialAttrs = JSONArray.parseArray(extJson.getString("specialAttrs")); JSONArray specialAttrs = JSONArray.parseArray(extJson.getString("specialAttrs"));
for (Object specialAttr : specialAttrs) { for (Object specialAttr : specialAttrs) {
JSONObject object = JSONObject.parseObject(specialAttr.toString()); JSONObject object = JSONObject.parseObject(specialAttr.toString());
specialExtra.setAttributeId(extJson.containsKey("attributeId") ? extJson.getString("attributeId") : ""); specialExtra.setAttributeId(object.containsKey("attributeId") ? object.getString("attributeId") : "");
specialExtra.setAttributeName(extJson.containsKey("attributeName") ? extJson.getString("attributeName") : ""); specialExtra.setAttributeName(object.containsKey("attributeName") ? object.getString("attributeName") : "");
specialExtra.setAttributeId(extJson.containsKey("specialCode") ? extJson.getString("specialCode") : ""); specialExtra.setAttributeId(object.containsKey("specialCode") ? object.getString("specialCode") : "");
} }
cartGoods.setSpecialExtra(Arrays.asList(specialExtra)); comboxGoods.setSpecialExtra(Arrays.asList(specialExtra));
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment