| | |
| | | private final MallGoodsCategoryMapper mallGoodsCategoryMapper; |
| | | |
| | | private final PlatformBannerMapper platformBannerMapper; |
| | | private final MallGoodsImagesMapper mallGoodsImagesMapper; |
| | | |
| | | @Override |
| | | public IPage<MallGoods> getCategoryListInPage(MallGoods mallGoods, QueryRequest request) { |
| | |
| | | BeanUtil.copyProperties(addMallGoodsDto, mallGoods); |
| | | mallGoods.setIsSale(MallGoods.ISSALE_STATUS_DISABLED); |
| | | mallGoodsMapper.insert(mallGoods); |
| | | |
| | | String thumbs = addMallGoodsDto.getThumbs(); |
| | | if (StrUtil.isNotEmpty(thumbs)) { |
| | | List<String> imgs = StrUtil.splitTrim(thumbs, ","); |
| | | if (CollUtil.isNotEmpty(imgs)) { |
| | | int i = 1; |
| | | for (String img : imgs) { |
| | | MallGoodsImages mallGoodsImages = new MallGoodsImages(); |
| | | mallGoodsImages.setGoodsId(mallGoods.getId()); |
| | | mallGoodsImages.setImageUrl(img); |
| | | mallGoodsImages.setSeq(i); |
| | | mallGoodsImagesMapper.insert(mallGoodsImages); |
| | | i++; |
| | | } |
| | | } |
| | | } |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public MallGoods selectGoodsById(long id) { |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(id); |
| | | List<String> thumbs = mallGoodsImagesMapper.selectByGoodId(mallGoods.getId()); |
| | | mallGoods.setImages(thumbs); |
| | | return mallGoods; |
| | | } |
| | | |
| | |
| | | BeanUtil.copyProperties(mallGoodsUpdateDto, mallGoods); |
| | | mallGoodsMapper.updateById(mallGoods); |
| | | |
| | | mallGoodsImagesMapper.deleteByGoodsId(mallGoodsUpdateDto.getId()); |
| | | String thumbs = mallGoodsUpdateDto.getThumbs(); |
| | | if (StrUtil.isNotEmpty(thumbs)) { |
| | | List<String> imgs = StrUtil.splitTrim(thumbs, ","); |
| | | if (CollUtil.isNotEmpty(imgs)) { |
| | | int i = 1; |
| | | for (String img : imgs) { |
| | | MallGoodsImages mallGoodsImages = new MallGoodsImages(); |
| | | mallGoodsImages.setGoodsId(mallGoods.getId()); |
| | | mallGoodsImages.setImageUrl(img); |
| | | mallGoodsImages.setSeq(i); |
| | | mallGoodsImagesMapper.insert(mallGoodsImages); |
| | | i++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |