feat: json序列化修改

This commit is contained in:
张松 2024-12-05 15:19:52 +08:00
parent e95640a4ad
commit 2bdd72287d
1 changed files with 7 additions and 2 deletions

View File

@ -239,7 +239,9 @@ public class OrderService {
if (food == null) {
throw new MsgException("存在无效套餐商品");
}
foods.add(food);
ProductGroupVo.Food copyFood = new ProductGroupVo.Food();
BeanUtil.copyProperties(copyFood, food);
foods.add(copyFood);
});
cashierCart.setProGroupInfo(JSONObject.toJSONString(foods));
@ -252,7 +254,10 @@ public class OrderService {
JSONObject.parseArray(groupSnap).forEach(item -> {
ProductGroupVo productGroupVo = ((JSONObject) item).toJavaObject(ProductGroupVo.class);
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);
});
});