商品校验调整
This commit is contained in:
parent
51c160aa26
commit
1157d4eb16
|
|
@ -1,5 +1,6 @@
|
|||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
|
|
@ -185,5 +186,6 @@ public class TbProduct implements Serializable {
|
|||
private Object groundingSpecInfo;
|
||||
private List<?> skuList;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -10,6 +10,8 @@ import com.chaozhanggui.system.cashierservice.entity.*;
|
|||
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStatusDTO;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStockDTO;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.QuerySpecDTO;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.ProductVo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.ShopCategoryVo;
|
||||
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
||||
import com.chaozhanggui.system.cashierservice.interceptor.LimitSubmitAspect;
|
||||
|
|
@ -17,6 +19,7 @@ import com.chaozhanggui.system.cashierservice.rabbit.RabbitProducer;
|
|||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
|
||||
import com.chaozhanggui.system.cashierservice.util.PageHelperUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -126,6 +129,9 @@ public class ProductService {
|
|||
String day = DateUtils.getDay();
|
||||
if(ObjectUtil.isNotEmpty(tbProducts)){
|
||||
tbProducts.parallelStream().forEach(it->{
|
||||
if("package".equals(it.getType())){
|
||||
it.setProGroupVo(JSONUtil.parseListTNewList(it.getGroupSnap(), ProductGroupVo.class));
|
||||
}
|
||||
Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, tableId);
|
||||
it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount);
|
||||
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue