liuleilei
2025-02-08 deeb762c202ed7d2eee2c9e0558e5f2ab466eec1
server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
@@ -646,6 +646,7 @@
        queryWrapper.leftJoin(Category.class, Category::getId, Goods::getCategoryId);
        queryWrapper.leftJoin(Brand.class, Brand::getId, Goods::getBrandId);
        queryWrapper.eq(Goods::getStatus,Constants.ZERO);
        queryWrapper.eq(Goods::getCompanyId, goods.getCompanyId());
        queryWrapper.eq(Goods::getIsdeleted,Constants.ZERO);
        queryWrapper.like(StringUtils.isNotBlank(goods.getAttrFirstIds()),Goods::getAttrFirstIds,goods.getAttrFirstIds());
        queryWrapper.like(StringUtils.isNotBlank(goods.getAttrFirstNames()),Goods::getAttrFirstNames,goods.getAttrFirstNames());
@@ -656,7 +657,8 @@
        queryWrapper.between(!Objects.isNull(goods.getSPrice())&&!Objects.isNull(goods.getEPrice()),
                Goods::getPrice,goods.getSPrice(),goods.getEPrice());
        queryWrapper.orderByDesc(Goods::getId);
        List<Goods> goodsList = goodsJoinMapper.selectJoinList(Goods.class,queryWrapper);
        List<Goods> goodsList =  this.goodsMapper.selectListByCollection(goods);
      //  List<Goods> goodsList = goodsJoinMapper.selectJoinList(Goods.class,queryWrapper);
        if(!Objects.isNull(goodsList)&&goodsList.size()>Constants.ZERO){
            this.dealGoodsMsg(goodsList);
        }
@@ -793,8 +795,8 @@
            if(brand == null){
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第【"+(num)+"】行商品品牌无效,请检查输入!");
            }
            if(goodsMapper.selectCount(new QueryWrapper<Goods>().eq("ISDELETED",Constants.ZERO).eq("name",m.getName()))>0){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"第【"+(num)+"】行【"+m.getName()+"】已存在");
            if(goodsMapper.selectCount(new QueryWrapper<Goods>().eq("COMPANY_ID",user.getCompanyId()).eq("ISDELETED",Constants.ZERO).eq("name",m.getName()))>0){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"第【"+(num)+"】行【"+m.getName()+"】已存在");
            }
            Goods newModel = new Goods();
            newModel.setRemark(m.getId());