diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java index f69cbcf..54010b0 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java @@ -1,11 +1,13 @@ package com.chaozhanggui.system.cashierservice.entity; +import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo; import lombok.Data; import org.springframework.data.annotation.Transient; import java.math.BigDecimal; import java.time.LocalTime; import java.io.Serializable; +import java.util.List; /** * (TbProduct)实体类 @@ -190,5 +192,7 @@ public class TbProduct implements Serializable { @Transient private TbProductSkuResult productSkuResult; + + private List proGroupVo; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java new file mode 100644 index 0000000..61d7a28 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java @@ -0,0 +1,34 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ProductGroupVo { + + private Integer count; + //选几个 + private Integer number; + //类别 + private String title; + + //食物 + private List goods=new ArrayList<>(); + + @Data + @JsonIgnoreProperties(ignoreUnknown = true) + public static class Food { + private Integer proId; + private String proName; + private Integer skuId; + private String skuName; + private BigDecimal price; + private String number; + private String unitName; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java index 8d5a312..9c4d456 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -472,6 +472,9 @@ public class ProductService { boolean isMemberPrice = shopInfo.getIsMemberPrice() != null && shopInfo.getIsMemberPrice() == 1; if (!CollectionUtils.isEmpty(products)) { products.parallelStream().forEach(it -> { + if("package".equals(it.getType())){ + it.setProGroupVo(JSONUtil.parseListTNewList(it.getGroupSnap(), ProductGroupVo.class)); + } TbShopUnit tbShopUnit = unitMapper.selectByPrimaryKey(Integer.valueOf(it.getUnitId())); it.setUnitSnap(tbShopUnit != null ? tbShopUnit.getName() : ""); if(check){