Commit 0e85cf89 by yu.sun

sunyu::update::new function about MCoffee Material

parent 45f73735
......@@ -152,10 +152,14 @@ public class ActivityCalculationDiscountRequestDto {
*/
private Integer goodsQuantity;
/**
* 加料
* 加料
*/
private Long originalPrice;
/**
* 加料现价
*/
private Integer nowPrice;
/**
* 1 :小料、2:可选搭配
*/
private int type;
......
......@@ -202,6 +202,10 @@ public class ActivityCalculationDiscountResponseDto {
*/
private String artNo;
/**
* 小料节点
*/
private List<GoodsMaterial> smallMaterial;
@Data
public static class GoodsDiscount {
......@@ -236,6 +240,38 @@ public class ActivityCalculationDiscountResponseDto {
*/
private Integer actualGoodsNumber;
}
@Data
public class GoodsMaterial{
/**
* 子商品类型:1-小料;2-可选商品
*/
private Integer type;
/**
* 小料商品ID
*/
private String goodsId;
/**
* 小料数量
*/
private Integer goodsQuantity;
/**
* 商品原价(单位:分)
*/
private Integer originalPrice;
/**
* 商品现价(单位:分)
*/
private Integer nowPrice;
/**
* 分摊到商品上的优惠总金额
*/
private Integer discountAmount;
/**
* 商品实付金额
*/
private Integer realAmount;
}
}
@Data
......
......@@ -24,8 +24,4 @@ public class MaterialRequestVo {
* 加料组ID(对应入机键位)
*/
private String groupId;
/**
* 加料数量
*/
private int qty;
}
......@@ -1138,6 +1138,7 @@ public class ShoppingCartMCoffeeServiceImpl {
for (MaterialRequestVo materialRequestVo : vo.getProductMaterialList()) {
CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods();
materialGoods.setSpuId(materialRequestVo.getSpuId());
materialGoods.setGroupId(materialRequestVo.getGroupId());
comboxMaterialGoodsList.add(materialGoods);
}
productCombox.setProductMaterialList(comboxMaterialGoodsList);
......@@ -1175,6 +1176,7 @@ public class ShoppingCartMCoffeeServiceImpl {
for (MaterialRequestVo materialRequestVo : vo.getProductMaterialList()) {
CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods();
materialGoods.setSpuId(materialRequestVo.getSpuId());
materialGoods.setGroupId(materialRequestVo.getGroupId());
comboxMaterialGoodsList.add(materialGoods);
}
productCombox.setProductMaterialList(comboxMaterialGoodsList);
......@@ -1189,6 +1191,7 @@ public class ShoppingCartMCoffeeServiceImpl {
for (MaterialRequestVo materialRequestVo : addShoppingCartGoodsRequestVo.getProductMaterialList()) {
CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods();
materialGoods.setSpuId(materialRequestVo.getSpuId());
materialGoods.setGroupId(materialRequestVo.getGroupId());
materialGoodsList.add(materialGoods);
}
cartGoods.setProductMaterialList(materialGoodsList);
......
......@@ -420,7 +420,8 @@ public class CalculationServiceImpl {
material.setType(1);
material.setGoodsId(materialGoods.getSpuId());
material.setGoodsQuantity(cartGoods.getQty());
material.setOriginalPrice(materialGoods.getFinalPrice());
material.setOriginalPrice(materialGoods.getOriginalPrice());
material.setNowPrice(materialGoods.getFinalPrice().intValue());
materials.add(material);
}
}
......
......@@ -40,10 +40,10 @@ public class MaterialCalculation {
private ShoppingCartConvertAdapter shoppingCartConvertAdapter;
public void updateShoppingCartGoodsApportion(ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, List<CartGoods> cartGoodsList) {
// HashMap<String, MaterialApportion> map = getApportionGoodsDetail(calculationDiscountResult);
//
// if (map.size() > 0) {
// String pk = "";
HashMap<String, MaterialApportion> map = getApportionGoodsDetail(calculationDiscountResult);
if (map.size() > 0) {
String pk = "";
// for (CartGoods product : cartGoodsList) {
// if (CollectionUtils.isEmpty(product.getProductMaterialList())) {
// continue;
......@@ -74,7 +74,7 @@ public class MaterialCalculation {
// product.setProductType(GoodsTypeEnum.MATERIAL.getGoodsType());
// }
// }
// }
}
// //将小料的价格累加到商品行上
// for (ShoppingCartGoodsDto.CartGoodsDetailDto product : products) {
// if (CollectionUtils.isEmpty(product.getMaterialList())) {
......
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