CeDo
2021-04-20 473402e5311304af36ac4cdc6bb7a129fa928168
Merge remote-tracking branch 'origin/master'
5个文件已修改
63 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopGoodsAttrDAO.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopCartServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopGoodsServiceImpl.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopStoreServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopGoodsAttrDAO.java
@@ -1,8 +1,13 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.common.model.vos.shop.ComShopGoodsAttrVO;
import com.panzhihua.service_community.model.dos.ComShopGoodsAttrDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
 * @auther lyq
@@ -12,4 +17,7 @@
@Mapper
public interface ComShopGoodsAttrDAO extends BaseMapper<ComShopGoodsAttrDO> {
    @Select("select id,goods_id as goodsId,store_id as storeId,goods_name as goodsName,goods_attr as goodsAttr,stock,sale,attr_pic as attrPic,is_default as isDefault,price from com_shop_goods_attr where goods_id = #{goodsId}")
    List<ComShopGoodsAttrVO> getGoodsAttr(@Param("goodsId") Long goodsId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopCartServiceImpl.java
@@ -69,6 +69,7 @@
                    ComShopCartVO invalidCart = new ComShopCartVO();
                    BeanUtils.copyProperties(shopCart,invalidCart);
                    invalidCartList.add(invalidCart);
                    return;
                }
                //有效商品区分店铺
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopGoodsServiceImpl.java
@@ -16,6 +16,7 @@
import com.panzhihua.common.model.vos.shop.AddShopGoodsAttrVO;
import com.panzhihua.common.model.vos.shop.PageShopGoodsVO;
import com.panzhihua.common.model.vos.shop.AddShopGoodsVO;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComShopGoodsAttrDAO;
import com.panzhihua.common.model.vos.shop.ComShopGoodsAttrVO;
import com.panzhihua.common.model.vos.shop.ComShopGoodsVO;
@@ -81,7 +82,11 @@
                shopGoodsAttrDO.setStoreId(goodDO.getStoreId());
                shopGoodsAttrDO.setGoodsName(goodDO.getName());
                //如果没有规格加默认
                shopGoodsAttrDO.setGoodsAttr(goodsAttr.getGoodsAttr());
                if(StringUtils.isNotEmpty(goodsAttr.getGoodsAttr())){
                    shopGoodsAttrDO.setGoodsAttr("默认");
                }else{
                    shopGoodsAttrDO.setGoodsAttr(goodsAttr.getGoodsAttr());
                }
                shopGoodsAttrDO.setIsDefault(1);
                shopGoodsAttrDO.setPrice(goodsAttr.getAttrPrice());
                goodsAttrDOS.add(shopGoodsAttrDO);
@@ -136,15 +141,16 @@
            }
            //先删除
            ComShopGoodsAttrDO goodsAttrDO = goodsAttrService.getBaseMapper().selectById(goodsAttr.getGoodsAttrId());
            if (goodsAttrDO == null) {
                throw new ServiceException("规格为空,请检查规格Id");
            }
            ComShopGoodsAttrDO shopGoodsAttrDO = new ComShopGoodsAttrDO();
            shopGoodsAttrDO.setGoodsId(id);
            shopGoodsAttrDO.setStoreId(shopGoodsDO.getStoreId());
            shopGoodsAttrDO.setGoodsName(shopGoodsDO.getName());
            //如果没有规格加默认
            shopGoodsAttrDO.setGoodsAttr(goodsAttr.getGoodsAttr());
            if (goodsAttrDO == null) {
                //如果没有规格加默认
                shopGoodsAttrDO.setGoodsAttr(goodsAttr.getGoodsAttr());
            }else{
                shopGoodsAttrDO.setGoodsAttr("默认");
            }
            shopGoodsAttrDO.setIsDefault(1);
            shopGoodsAttrDO.setPrice(goodsAttr.getAttrPrice());
            goodsAttrDOS.add(shopGoodsAttrDO);
@@ -187,9 +193,18 @@
     * @return 商品列表
     */
    @Override
    public R pageShopGoods(ComShopGoodsDTO comShopGoodsDTO) {
        Page page = new Page<>(comShopGoodsDTO.getPageNum(), comShopGoodsDTO.getPageSize());
        return R.ok(this.baseMapper.pageShopGoodByApps(page, comShopGoodsDTO));
    public R pageShopGoods(ComShopGoodsDTO comShopGoodsDTO){
        Page page = new Page<>(comShopGoodsDTO.getPageNum(),comShopGoodsDTO.getPageSize());
        IPage<ComShopGoodsVO> goodsVOIPage = this.baseMapper.pageShopGoodByApps(page,comShopGoodsDTO);
        if(!goodsVOIPage.getRecords().isEmpty()){
            goodsVOIPage.getRecords().forEach(goodsVo -> {
                List<ComShopGoodsAttrVO> goodsAttrList = shopGoodsAttrDAO.getGoodsAttr(goodsVo.getId());
                if(!goodsAttrList.isEmpty()){
                    goodsVo.setGoodsAttrList(goodsAttrList);
                }
            });
        }
        return R.ok(goodsVOIPage);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java
@@ -696,7 +696,7 @@
        shopOrderDO.setPayStatus(ComShopOrderDO.payStatus.yes);
        shopOrderDO.setPayAmount(BigDecimal.valueOf(Integer.parseInt(wxPayNotifyOrderDTO.getCashFee()) / 100));
        shopOrderDO.setWxTardeNo(wxPayNotifyOrderDTO.getWxTradeNo());
        shopOrderDO.setPayTime(new Date(Long.parseLong(wxPayNotifyOrderDTO.getPayTime())));
        shopOrderDO.setPayTime(new Date(Long.parseLong(wxPayNotifyOrderDTO.getPayTime() + "000")));
        this.baseMapper.updateById(shopOrderDO);
        //查询订单商品
@@ -728,7 +728,6 @@
                comShopStoreDAO.updateById(storeDO);
            }
        }
        //添加订单操作记录
        ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopStoreServiceImpl.java
@@ -6,11 +6,11 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.shop.*;
import com.panzhihua.common.model.vos.shop.PageShopStoreVO;
import com.panzhihua.common.model.vos.shop.PageShopStoreVO;
import com.panzhihua.service_community.dao.ComShopGoodsAttrDAO;
import com.panzhihua.service_community.dao.ComShopGoodsDAO;
import com.panzhihua.common.model.vos.shop.PageShopStoreVO;
import com.panzhihua.common.model.vos.shop.ShopStoreVO;
import com.panzhihua.service_community.dao.ComShopStoreDAO;
import com.panzhihua.service_community.model.dos.ComShopStoreDO;
import com.panzhihua.service_community.service.ComShopStoreService;
@@ -32,6 +32,8 @@
    @Resource
    private ComShopGoodsDAO shopGoodsDAO;
    @Resource
    private ComShopGoodsAttrDAO comShopGoodsAttrDAO;
    /**
     * 查询店铺列表
@@ -68,8 +70,18 @@
        //查询店铺下商品信息
        Page page = new Page<>(comShopStoreDTO.getPageNum(), comShopStoreDTO.getPageSize());
        shopStoreVO.setGoodsList(shopGoodsDAO.pageShopGoodsByStoreId(page, comShopStoreDTO).getRecords());
        List<ComShopGoodsVO> goodsList = shopGoodsDAO.pageShopGoodsByStoreId(page, comShopStoreDTO).getRecords();
        if(!goodsList.isEmpty()){
            //查询商品规格列表
            goodsList.forEach(goods -> {
                List<ComShopGoodsAttrVO> goodsAttrList = comShopGoodsAttrDAO.getGoodsAttr(goods.getId());
                if(!goodsAttrList.isEmpty()){
                    goods.setGoodsAttrList(goodsAttrList);
                }
            });
        }
        shopStoreVO.setGoodsList(goodsList);
        return R.ok(shopStoreVO);
    }