yanghui
2022-11-15 a1a51a92fd386ff07a7f05e40076508430a3c026
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);
    }