商品字段调整
This commit is contained in:
@@ -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<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;
|
||||
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){
|
||||
|
||||
Reference in New Issue
Block a user