sf
jiangping
2025-04-30 dcdb0231034810232f2542f3865666ebf72daf11
server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
@@ -379,6 +379,7 @@
        if(!Objects.isNull(goodsParamList)&&goodsParamList.size()>0){
            for (int i = 0; i < goodsParamList.size(); i++) {
                GoodsParam goodsParam = goodsParamList.get(i);
                goodsParam.setId(null);
                goodsParam.setCreator(user.getId());
                goodsParam.setCreateDate(new Date());
                goodsParam.setIsdeleted(Constants.ZERO);
@@ -508,6 +509,7 @@
        if(!Objects.isNull(goodsParamList)&&goodsParamList.size()>0){
            for (int i = 0; i < goodsParamList.size(); i++) {
                GoodsParam goodsParam = goodsParamList.get(i);
                goodsParam.setId(null);
                goodsParam.setCreator(user.getId());
                goodsParam.setCreateDate(new Date());
                goodsParam.setIsdeleted(Constants.ZERO);
@@ -646,6 +648,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 +659,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 +797,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());