From 3ce3f20b50e85b53b161438134f187409bcd65a5 Mon Sep 17 00:00:00 2001 From: DESKTOP-71BH0QO\L、ming <172680469@qq.com> Date: 星期二, 20 四月 2021 21:46:55 +0800 Subject: [PATCH] no --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopGoodsServiceImpl.java | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopGoodsServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopGoodsServiceImpl.java index 8a98bd7..144b255 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopGoodsServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopGoodsServiceImpl.java @@ -52,8 +52,13 @@ if (addShopGoodsVO == null) { return R.ok("500", "数据为空!"); } + String[] images = addShopGoodsVO.getGoodsPic().split(","); ComShopGoodsDO shopGoodsDO = new ComShopGoodsDO(); BeanUtils.copyProperties(addShopGoodsVO, shopGoodsDO); + if(images.length>1){ + shopGoodsDO.setGoodsPic(images[0]); + } + shopGoodsDO.setImages(addShopGoodsVO.getGoodsPic()); shopGoodsDO.setSale(0); int goodsId = this.baseMapper.insert(shopGoodsDO); if (goodsId > 0) { @@ -76,6 +81,7 @@ } shopGoodsAttrDO.setIsDefault(1); shopGoodsAttrDO.setPrice(goodsAttr.getAttrPrice()); + shopGoodsAttrDO.setAttrPic(images[0]); goodsAttrDOS.add(shopGoodsAttrDO); }); if (goodsAttrDOS.size() > 0) { -- Gitblit v1.7.1