From 81da61b828e29b7745e1382dfbbaeb685dc083ef Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 23 一月 2024 17:17:55 +0800 Subject: [PATCH] 抖音转链修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsImgServiceImpl.java | 148 ++++++++++++++++++++++++------------------------ 1 files changed, 74 insertions(+), 74 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsImgServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsImgServiceImpl.java index 6b36aec..363e7ad 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsImgServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsImgServiceImpl.java @@ -1,74 +1,74 @@ -package com.yeshi.fanli.service.impl.shop; - -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsImgMapper; -import com.yeshi.fanli.entity.shop.BanLiShopGoods; -import com.yeshi.fanli.entity.shop.BanLiShopGoodsImg; -import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsImgService; -import com.yeshi.fanli.util.StringUtil; - -@Service -public class BanLiShopGoodsImgServiceImpl implements BanLiShopGoodsImgService { - - @Resource - private BanLiShopGoodsImgMapper banLiShopGoodsImgMapper; - - // 娣诲姞鍥剧墖 - @Override - public void addImg(String pictureUrl, Long goodsId) { - if (StringUtil.isNullOrEmpty(pictureUrl) || goodsId == null) { - return; - } - String imgMD5 = StringUtil.Md5(pictureUrl); - BanLiShopGoodsImg img = new BanLiShopGoodsImg(); - img.setCreateTime(new Date()); - img.setGoods(new BanLiShopGoods(goodsId)); - img.setUrl(pictureUrl); - img.setUrlMD5(imgMD5); - banLiShopGoodsImgMapper.insertSelective(img); - if (img.getWeight() == null) { - BanLiShopGoodsImg update = new BanLiShopGoodsImg(); - update.setId(img.getId()); - update.setWeight((int) img.getId().longValue()); - banLiShopGoodsImgMapper.updateByPrimaryKeySelective(update); - } - } - - @Override - public List<BanLiShopGoodsImg> listByGoodsId(Long goodsId) { - return banLiShopGoodsImgMapper.listByGoodsId(goodsId); - } - - @Override - public BanLiShopGoodsImg selectByPrimaryKey(Long id) { - return banLiShopGoodsImgMapper.selectByPrimaryKey(id); - } - - @Override - public void updateSelectiveByPrimaryKey(BanLiShopGoodsImg img) { - if (img == null || img.getId() == null) - return; - banLiShopGoodsImgMapper.updateByPrimaryKeySelective(img); - } - - @Transactional - @Override - public void delete(List<Long> idsList) { - if (idsList != null) - for (Long id : idsList) - deleteByPrimaryKey(id); - } - - @Override - public void deleteByPrimaryKey(Long id) { - banLiShopGoodsImgMapper.deleteByPrimaryKey(id); - } - -} +package com.yeshi.fanli.service.impl.shop; + +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsImgMapper; +import com.yeshi.fanli.entity.shop.BanLiShopGoods; +import com.yeshi.fanli.entity.shop.BanLiShopGoodsImg; +import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsImgService; +import com.yeshi.fanli.util.StringUtil; + +@Service +public class BanLiShopGoodsImgServiceImpl implements BanLiShopGoodsImgService { + + @Resource + private BanLiShopGoodsImgMapper banLiShopGoodsImgMapper; + + // 娣诲姞鍥剧墖 + @Override + public void addImg(String pictureUrl, Long goodsId) { + if (StringUtil.isNullOrEmpty(pictureUrl) || goodsId == null) { + return; + } + String imgMD5 = StringUtil.Md5(pictureUrl); + BanLiShopGoodsImg img = new BanLiShopGoodsImg(); + img.setCreateTime(new Date()); + img.setGoods(new BanLiShopGoods(goodsId)); + img.setUrl(pictureUrl); + img.setUrlMD5(imgMD5); + banLiShopGoodsImgMapper.insertSelective(img); + if (img.getWeight() == null) { + BanLiShopGoodsImg update = new BanLiShopGoodsImg(); + update.setId(img.getId()); + update.setWeight((int) img.getId().longValue()); + banLiShopGoodsImgMapper.updateByPrimaryKeySelective(update); + } + } + + @Override + public List<BanLiShopGoodsImg> listByGoodsId(Long goodsId) { + return banLiShopGoodsImgMapper.listByGoodsId(goodsId); + } + + @Override + public BanLiShopGoodsImg selectByPrimaryKey(Long id) { + return banLiShopGoodsImgMapper.selectByPrimaryKey(id); + } + + @Override + public void updateSelectiveByPrimaryKey(BanLiShopGoodsImg img) { + if (img == null || img.getId() == null) + return; + banLiShopGoodsImgMapper.updateByPrimaryKeySelective(img); + } + + @Transactional + @Override + public void delete(List<Long> idsList) { + if (idsList != null) + for (Long id : idsList) + deleteByPrimaryKey(id); + } + + @Override + public void deleteByPrimaryKey(Long id) { + banLiShopGoodsImgMapper.deleteByPrimaryKey(id); + } + +} -- Gitblit v1.8.0