单位为空的问题
This commit is contained in:
@@ -389,7 +389,12 @@ public class ProductService {
|
|||||||
*/
|
*/
|
||||||
public List<TbProduct> handleDate(List<TbProduct> products,boolean check,Integer isSale,boolean isVip){
|
public List<TbProduct> handleDate(List<TbProduct> products,boolean check,Integer isSale,boolean isVip){
|
||||||
if (!CollectionUtils.isEmpty(products)) {
|
if (!CollectionUtils.isEmpty(products)) {
|
||||||
products.forEach(it -> {
|
products.parallelStream().forEach(it -> {
|
||||||
|
TbShopUnit tbShopUnit = unitMapper.selectByPrimaryKey(Integer.valueOf(it.getUnitId()));
|
||||||
|
if (it.getName().equals("烤牛肉")) {
|
||||||
|
System.out.println("单位:"+tbShopUnit.getName());
|
||||||
|
}
|
||||||
|
it.setUnitSnap(tbShopUnit != null ? tbShopUnit.getName() : "");
|
||||||
if(check){
|
if(check){
|
||||||
List<TbProductGroup> tbProductGroups = tbProductGroupMapper.selectByProductId(it.getShopId(), it.getId().toString());
|
List<TbProductGroup> tbProductGroups = tbProductGroupMapper.selectByProductId(it.getShopId(), it.getId().toString());
|
||||||
for (TbProductGroup g : tbProductGroups) {
|
for (TbProductGroup g : tbProductGroups) {
|
||||||
@@ -403,8 +408,6 @@ public class ProductService {
|
|||||||
}else {
|
}else {
|
||||||
it.setIsSale(isSale);
|
it.setIsSale(isSale);
|
||||||
}
|
}
|
||||||
TbShopUnit tbShopUnit = unitMapper.selectByPrimaryKey(Integer.valueOf(it.getUnitId()));
|
|
||||||
it.setUnitSnap(tbShopUnit != null ? tbShopUnit.getName() : "");
|
|
||||||
//购物车数量
|
//购物车数量
|
||||||
it.setCartNumber("0");
|
it.setCartNumber("0");
|
||||||
List<TbProductSku> tbProductSkus = tbProductSkuMapper.selectGroundingByProId(it.getId());
|
List<TbProductSku> tbProductSkus = tbProductSkuMapper.selectGroundingByProId(it.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user