From 5e7892cd0921111dfbaf84196f2593f8045d1c11 Mon Sep 17 00:00:00 2001 From: yanghui <2536613402@qq.com> Date: 星期四, 08 十二月 2022 13:16:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/haucheng_panzhihua' into haucheng_panzhihua --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java index e61634c..75f77c8 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java @@ -2,7 +2,6 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; -import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -17,7 +16,6 @@ import com.panzhihua.common.model.vos.shop.*; import com.panzhihua.common.utlis.DifferentLongListUtil; import com.panzhihua.common.utlis.Snowflake; -import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; import com.panzhihua.service_community.service.ComShopFlowerGoodsAttrService; @@ -141,13 +139,11 @@ ArrayList<AddShopFlowerGoodsAttrVO> goodsAttrVOList = Lists.newArrayList(); StringBuilder sbr = new StringBuilder(); int stock = 0; - int sale = 0; for (ComShopFlowerGoodsAttrDO oneGoodsAttrDO : goodsAttrDOs) { AddShopFlowerGoodsAttrVO goodsAttrVO = new AddShopFlowerGoodsAttrVO(); BeanUtils.copyProperties(oneGoodsAttrDO, goodsAttrVO); - goodsAttrVO.setGoodsAttrId(oneGoodsAttrDO.getId()); + goodsAttrVO.setId(oneGoodsAttrDO.getId()); goodsAttrVOList.add(goodsAttrVO); - sale = sale + oneGoodsAttrDO.getSale(); stock = stock +oneGoodsAttrDO.getStock(); sbr.append(oneGoodsAttrDO.getGoodsAttrName()).append(" "); } @@ -161,7 +157,6 @@ String categoryNames = convenientGoodsCategoryDAO.selectCategoryScopeByGoodsId(shopGoods.getId()); shopGoods.setCategoryName(categoryNames); shopGoods.setStock(stock); - shopGoods.setSale(sale); }); } return R.ok(comShopStoreVOIPage); @@ -286,7 +281,7 @@ } else { List<Long> attrIds = comShopFlowerGoodsAttrDOS.stream().map(ComShopFlowerGoodsAttrDO::getId).collect(Collectors.toList()); - List<Long> voAttrIds = addShopFlowerGoodsVO.getGoodsAttrVOList().stream().map(AddShopFlowerGoodsAttrVO::getGoodsAttrId) + List<Long> voAttrIds = addShopFlowerGoodsVO.getGoodsAttrVOList().stream().map(AddShopFlowerGoodsAttrVO::getId) .collect(Collectors.toList()); // 需要删除的规格ID——针对编辑时删除了规格的情况 List<Long> deleteIds = DifferentLongListUtil.getDiffrent(attrIds, voAttrIds); @@ -294,7 +289,7 @@ shopFlowerGoodsAttrDAO.deleteBatchIds(deleteIds); } addShopFlowerGoodsVO.getGoodsAttrVOList().forEach(goodsAttr -> { - ComShopFlowerGoodsAttrDO comShopGoodsAttrDO = shopFlowerGoodsAttrDAO.selectById(goodsAttr.getGoodsAttrId()); + ComShopFlowerGoodsAttrDO comShopGoodsAttrDO = shopFlowerGoodsAttrDAO.selectById(goodsAttr.getId()); if (comShopGoodsAttrDO != null) { comShopGoodsAttrDO.setPrice(goodsAttr.getPrice()); comShopGoodsAttrDO.setCollatePrice(goodsAttr.getCollatePrice()); -- Gitblit v1.7.1