Commit 0e85cf89 by yu.sun

sunyu::update::new function about MCoffee Material

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