From a1a51a92fd386ff07a7f05e40076508430a3c026 Mon Sep 17 00:00:00 2001 From: yanghui <2536613402@qq.com> Date: 星期二, 15 十一月 2022 14:30:33 +0800 Subject: [PATCH] #feat 订单、商品、用户地址、评价 接口新增 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 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 27ed52b..d2ca497 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 @@ -16,14 +16,10 @@ import com.panzhihua.common.utlis.DifferentLongListUtil; import com.panzhihua.common.utlis.Snowflake; import com.panzhihua.common.utlis.StringUtils; -import com.panzhihua.service_community.dao.ComShopFlowerGoodsAttrDAO; -import com.panzhihua.service_community.dao.ComShopFlowerGoodsDAO; -import com.panzhihua.service_community.dao.ConvenientGoodsCategoryDAO; -import com.panzhihua.service_community.dao.ConvenientMerchantDAO; +import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; import com.panzhihua.service_community.service.ComShopFlowerGoodsAttrService; import com.panzhihua.service_community.service.ComShopFlowerGoodsService; -import com.panzhihua.service_community.service.ConvenientGoodsCategoryService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -53,6 +49,10 @@ private ConvenientMerchantDAO convenientMerchantDAO; @Resource private ConvenientGoodsCategoryDAO convenientGoodsCategoryDAO; + @Resource + private ComShopFlowerOrderGoodsDAO comShopFlowerOrderGoodsDAO; + @Resource + private ComShopFlowerEvaluateDAO comShopFlowerEvaluateDAO; @Override public R saveShopFlowerGoods(AddShopFlowerGoodsVO addShopFlowerGoodsVO) { @@ -160,7 +160,8 @@ IPage<ComShopFlowerGoodsVO> goodsVOIPage = this.baseMapper.pageShopGoodByApps(page, comShopFlowerGoodsDTO); if (!goodsVOIPage.getRecords().isEmpty()) { goodsVOIPage.getRecords().forEach(goodsVo -> { - List<ComShopFlowerGoodsAttrVO> goodsAttrList = shopFlowerGoodsAttrDAO.getGoodsAttr(goodsVo.getId()); + Long goodsId = goodsVo.getId(); + List<ComShopFlowerGoodsAttrVO> goodsAttrList = shopFlowerGoodsAttrDAO.getGoodsAttr(goodsId); if (!goodsAttrList.isEmpty()) { ComShopFlowerGoodsAttrVO comShopFlowerGoodsAttrVO = goodsAttrList.get(0); goodsVo.setGoodsAttrList(goodsAttrList); @@ -168,6 +169,7 @@ goodsVo.setOriginalPrice(comShopFlowerGoodsAttrVO.getPrice()); goodsVo.setPrice(comShopFlowerGoodsAttrVO.getCollatePrice()); } + }); } return R.ok(goodsVOIPage); @@ -209,6 +211,10 @@ shopGoods.setGoodsAttrList(goodsAttrList); shopGoods.setConvenientMerchantVO(convenientMerchantVO); shopGoods.setImages(StringUtils.join(images,",")); + Integer orderNum = comShopFlowerOrderGoodsDAO.selectCount(new LambdaQueryWrapper<ComShopFlowerOrderGoodsDO>().eq(ComShopFlowerOrderGoodsDO::getGoodsId, goodsId)); + shopGoods.setOrderNum(orderNum); + List<ComShopFlowerEvaluateVO> comShopFlowerEvaluateVOList = comShopFlowerEvaluateDAO.selectListLimit(goodsId); + shopGoods.setShopFlowerEvaluateVOList(comShopFlowerEvaluateVOList); return R.ok(shopGoods); } -- Gitblit v1.7.1