商品字段调整
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
package com.chaozhanggui.system.cashierservice.entity;
|
||||||
|
|
||||||
|
import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.data.annotation.Transient;
|
import org.springframework.data.annotation.Transient;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (TbProduct)实体类
|
* (TbProduct)实体类
|
||||||
@@ -190,5 +192,7 @@ public class TbProduct implements Serializable {
|
|||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
private TbProductSkuResult productSkuResult;
|
private TbProductSkuResult productSkuResult;
|
||||||
|
|
||||||
|
private List<ProductGroupVo> proGroupVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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<Food> 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -472,6 +472,9 @@ public class ProductService {
|
|||||||
boolean isMemberPrice = shopInfo.getIsMemberPrice() != null && shopInfo.getIsMemberPrice() == 1;
|
boolean isMemberPrice = shopInfo.getIsMemberPrice() != null && shopInfo.getIsMemberPrice() == 1;
|
||||||
if (!CollectionUtils.isEmpty(products)) {
|
if (!CollectionUtils.isEmpty(products)) {
|
||||||
products.parallelStream().forEach(it -> {
|
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()));
|
TbShopUnit tbShopUnit = unitMapper.selectByPrimaryKey(Integer.valueOf(it.getUnitId()));
|
||||||
it.setUnitSnap(tbShopUnit != null ? tbShopUnit.getName() : "");
|
it.setUnitSnap(tbShopUnit != null ? tbShopUnit.getName() : "");
|
||||||
if(check){
|
if(check){
|
||||||
|
|||||||
Reference in New Issue
Block a user