diff --git a/ghy-admin/src/main/resources/templates/order/master.html b/ghy-admin/src/main/resources/templates/order/master.html index 8a1d8b3a..9fdcf26a 100644 --- a/ghy-admin/src/main/resources/templates/order/master.html +++ b/ghy-admin/src/main/resources/templates/order/master.html @@ -20,7 +20,7 @@ 订单号:
  • - 订单状态: diff --git a/ghy-goods/src/main/java/com/ghy/goods/service/impl/GoodsServiceImpl.java b/ghy-goods/src/main/java/com/ghy/goods/service/impl/GoodsServiceImpl.java index 9cb43e1a..e3d048d0 100644 --- a/ghy-goods/src/main/java/com/ghy/goods/service/impl/GoodsServiceImpl.java +++ b/ghy-goods/src/main/java/com/ghy/goods/service/impl/GoodsServiceImpl.java @@ -5,7 +5,6 @@ import com.ghy.common.core.text.Convert; import com.ghy.common.exception.ServiceException; import com.ghy.common.utils.StringUtils; import com.ghy.goods.domain.Goods; -import com.ghy.goods.domain.GoodsArea; import com.ghy.goods.domain.GoodsStandard; import com.ghy.goods.mapper.GoodsMapper; import com.ghy.goods.request.AppGoodsRequest; @@ -16,9 +15,11 @@ import com.ghy.goods.service.GoodsStandardService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; +import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -47,11 +48,15 @@ public class GoodsServiceImpl implements GoodsService { int result = goodsMapper.insertGoods(goods); // 给各组件插入商品主体id - goods.getGoodsAreaList().forEach(goodsArea -> {goodsArea.setGoodsId(goods.getGoodsId());}); - goods.getGoodsImgsList().forEach(goodsImg -> {goodsImg.setGoodsId(goods.getGoodsId());}); + goods.getGoodsAreaList().forEach(goodsArea -> { + goodsArea.setGoodsId(goods.getGoodsId()); + }); + goods.getGoodsImgsList().forEach(goodsImg -> { + goodsImg.setGoodsId(goods.getGoodsId()); + }); goods.getGoodsStandardList().forEach(goodsStandard -> { goodsStandard.setGoodsId(goods.getGoodsId()); - if(goodsStandard.getExtMoney() == null){ + if (goodsStandard.getExtMoney() == null) { goodsStandard.setExtMoney(BigDecimal.ZERO); } }); @@ -146,6 +151,9 @@ public class GoodsServiceImpl implements GoodsService { @Override public List selectByIds(Collection ids) { + if (CollectionUtils.isEmpty(ids)) { + return new ArrayList<>(0); + } return goodsMapper.selectByIds(ids); }