feat: json序列化修改
This commit is contained in:
@@ -239,7 +239,9 @@ public class OrderService {
|
|||||||
if (food == null) {
|
if (food == null) {
|
||||||
throw new MsgException("存在无效套餐商品");
|
throw new MsgException("存在无效套餐商品");
|
||||||
}
|
}
|
||||||
foods.add(food);
|
ProductGroupVo.Food copyFood = new ProductGroupVo.Food();
|
||||||
|
BeanUtil.copyProperties(copyFood, food);
|
||||||
|
foods.add(copyFood);
|
||||||
});
|
});
|
||||||
|
|
||||||
cashierCart.setProGroupInfo(JSONObject.toJSONString(foods));
|
cashierCart.setProGroupInfo(JSONObject.toJSONString(foods));
|
||||||
@@ -252,7 +254,10 @@ public class OrderService {
|
|||||||
JSONObject.parseArray(groupSnap).forEach(item -> {
|
JSONObject.parseArray(groupSnap).forEach(item -> {
|
||||||
ProductGroupVo productGroupVo = ((JSONObject) item).toJavaObject(ProductGroupVo.class);
|
ProductGroupVo productGroupVo = ((JSONObject) item).toJavaObject(ProductGroupVo.class);
|
||||||
productGroupVo.getGoods().forEach(goods -> {
|
productGroupVo.getGoods().forEach(goods -> {
|
||||||
groupVoHashMap.put(goods.getProId().toString(), goods);
|
ProductGroupVo.Food copyFood = new ProductGroupVo.Food();
|
||||||
|
BeanUtil.copyProperties(copyFood, goods);
|
||||||
|
foods.add(copyFood);
|
||||||
|
groupVoHashMap.put(goods.getProId().toString(), copyFood);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user