| | |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+baseGoods.getName()+"】已存在"); |
| | | // } |
| | | |
| | | Integer integer = baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>().eq("ISDELETED", Constants.ZERO)); |
| | | Long integer = baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>().eq("ISDELETED", Constants.ZERO)); |
| | | BaseGoods insert = new BaseGoods(); |
| | | insert.setCreator(user.getId()); |
| | | insert.setCreateDate(new Date()); |
| | |
| | | BaseGoods model = new BaseGoods(); |
| | | model.setId(id); |
| | | model.setEditDate(new Date()); |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setIsdeleted(Constants.ONE); |
| | | updateById(model); |
| | | // baseGoodsMapper.deleteById(id); |
| | | } |
| | |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.leftJoin(Brand.class,Brand::getId,BaseGoods::getBrandId) |
| | | .leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getCategoryId) |
| | | // .leftJoin(BaseData.class,BaseData::getId,BaseGoods::getBaseDataId) |
| | | .selectAll(BaseGoods.class) |
| | | .selectAs(BaseCategory::getPriceRate,BaseGoods::getCateRatePrice) |
| | | .selectAs(Brand::getName,BaseGoods::getBrandName) |
| | | // .selectAs(BaseData::getPrice,BaseGoods::getJdPrice) |
| | | .selectAs(BaseCategory::getName,BaseGoods::getCategoryName) |
| | | .eq(BaseGoods::getIsdeleted, Constants.ZERO) |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getName()), BaseGoods::getName,pageWrap.getModel().getName()) |
| | |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode(); |
| | | pageData.getRecords().forEach(i->{ |
| | | i.setFullImgUrl(prefixUrl + i.getImgurl()); |
| | | if(StringUtils.isNotBlank(i.getImgurl())){ |
| | | i.setFullImgUrl(prefixUrl + i.getImgurl()); |
| | | } |
| | | i.setJdPrice(i.getPrice()); |
| | | i.setPrice(Constants.formatBigdecimal(i.getPrice()).multiply(Constants.formatBigdecimal(i.getCateRatePrice()))); |
| | | }); |
| | | return pageData; |
| | | } |
| | |
| | | .leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getCategoryId) |
| | | .selectAll(BaseGoods.class) |
| | | .selectAs(Brand::getName,BaseGoods::getBrandName) |
| | | .selectAs(BaseCategory::getPriceRate,BaseGoods::getCateRatePrice) |
| | | .selectAs(BaseCategory::getName,BaseGoods::getCategoryName) |
| | | .eq(BaseGoods::getStatus, Constants.ZERO) |
| | | .eq(BaseGoods::getIsdeleted, Constants.ZERO) |
| | |
| | | .eq(pageWrap.getModel().getCategoryId()!=null,BaseGoods::getCategoryId, pageWrap.getModel().getCategoryId()) |
| | | .eq(pageWrap.getModel().getBrandId()!=null,BaseGoods::getBrandId, pageWrap.getModel().getBrandId()) |
| | | .eq(pageWrap.getModel().getStatus()!=null,BaseGoods::getStatus, pageWrap.getModel().getStatus()) |
| | | .notExists(user.getType().equals(Constants.UserType.COMPANY.getKey())," select 1 from goods g where g.GOODS_ID = t.id and g.TYPE = 1 and g.company_id = "+user.getCompanyId()+" "); |
| | | .notExists(user.getType().equals(Constants.UserType.COMPANY.getKey())," select 1 from goods g where g.GOODS_ID = t.id and g.TYPE = 1 and g.ISDELETED = 0 and g.company_id = "+user.getCompanyId()+" "); |
| | | queryWrapper.orderByDesc(Goods::getId); |
| | | PageData<BaseGoods> pageData =PageData.from(baseGoodsJoinMapper.selectJoinPage(page,BaseGoods.class,queryWrapper)); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode(); |
| | | pageData.getRecords().forEach(i->{ |
| | | i.setFullImgUrl(prefixUrl + i.getImgurl()); |
| | | //加价系数 |
| | | i.setPrice(Constants.formatBigdecimal(i.getPrice()).multiply(Constants.formatBigdecimal(i.getCateRatePrice()))); |
| | | }); |
| | | return pageData; |
| | | } |
| | |
| | | // baseGoods.setImgurl(); |
| | | baseGoods.setCategoryId(baseCategory.getId()); |
| | | baseGoods.setBrandId(brand.getId()); |
| | | baseGoods.setPinyin(PinYinUtil.getFullSpell(s.getName())); |
| | | baseGoods.setShortPinyin(PinYinUtil.getFirstSpell(s.getName())); |
| | | baseGoodsMapper.insert(baseGoods); |
| | | |
| | | if(mulFiles !=null && mulFiles.size()>0){ |