From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsClassServiceImpl.java | 156 ++++++++++++++++++++++++++-------------------------- 1 files changed, 78 insertions(+), 78 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsClassServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsClassServiceImpl.java index 6247484..b7b4e1e 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsClassServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsClassServiceImpl.java @@ -1,78 +1,78 @@ -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.yeshi.utils.tencentcloud.COSManager; - -import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsClassMapper; -import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass; -import com.yeshi.fanli.exception.shop.BanLiShopGoodsClassException; -import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService; -import com.yeshi.fanli.util.StringUtil; - -@Service -public class BanLiShopGoodsClassServiceImpl implements BanLiShopGoodsClassService { - - @Resource - private BanLiShopGoodsClassMapper banLiShopGoodsClassMapper; - - @Override - public BanLiShopGoodsClass selectByPrimaryKey(Long id) { - return banLiShopGoodsClassMapper.selectByPrimaryKey(id); - } - - - @Override - public List<BanLiShopGoodsClass> listAllGoodsClass() { - return banLiShopGoodsClassMapper.listAllGoodsClass(); - } - - @Override - public List<BanLiShopGoodsClass> listGoodsClass(int page, int pageSize, String key) { - return banLiShopGoodsClassMapper.listGoodsClass((page - 1) * pageSize, pageSize, key); - } - - @Override - public long countGoodsClass(String key) { - return banLiShopGoodsClassMapper.countGoodsClass(key); - } - - - @Override - public void save( BanLiShopGoodsClass record) throws BanLiShopGoodsClassException { - String name = record.getName(); - if (StringUtil.isNullOrEmpty(name)) - throw new BanLiShopGoodsClassException(1, "鍚嶇О涓嶈兘涓虹┖"); - - record.setUpdateTime(new Date()); - if (record.getId() == null) { - record.setCreateTime(new Date()); - banLiShopGoodsClassMapper.insert(record); - } else { - BanLiShopGoodsClass resultObj = banLiShopGoodsClassMapper.selectByPrimaryKey(record.getId()); - if (resultObj == null) - throw new BanLiShopGoodsClassException(1, "淇敼鍐呭宸蹭笉瀛樺湪"); - - if (StringUtil.isNullOrEmpty(record.getPicture())) { - record.setPicture(resultObj.getPicture()); - } else if (!StringUtil.isNullOrEmpty(resultObj.getPicture())) { - COSManager.getInstance().deleteFile(resultObj.getPicture()); - } - record.setCreateTime(resultObj.getCreateTime()); - banLiShopGoodsClassMapper.updateByPrimaryKey(record); - } - } - - - @Override - public void delete(List<Long> idsList) { - if (idsList != null) - for (Long id : idsList) - banLiShopGoodsClassMapper.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.yeshi.utils.tencentcloud.COSManager; + +import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsClassMapper; +import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass; +import com.yeshi.fanli.exception.shop.BanLiShopGoodsClassException; +import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService; +import com.yeshi.fanli.util.StringUtil; + +@Service +public class BanLiShopGoodsClassServiceImpl implements BanLiShopGoodsClassService { + + @Resource + private BanLiShopGoodsClassMapper banLiShopGoodsClassMapper; + + @Override + public BanLiShopGoodsClass selectByPrimaryKey(Long id) { + return banLiShopGoodsClassMapper.selectByPrimaryKey(id); + } + + + @Override + public List<BanLiShopGoodsClass> listAllGoodsClass() { + return banLiShopGoodsClassMapper.listAllGoodsClass(); + } + + @Override + public List<BanLiShopGoodsClass> listGoodsClass(int page, int pageSize, String key) { + return banLiShopGoodsClassMapper.listGoodsClass((page - 1) * pageSize, pageSize, key); + } + + @Override + public long countGoodsClass(String key) { + return banLiShopGoodsClassMapper.countGoodsClass(key); + } + + + @Override + public void save( BanLiShopGoodsClass record) throws BanLiShopGoodsClassException { + String name = record.getName(); + if (StringUtil.isNullOrEmpty(name)) + throw new BanLiShopGoodsClassException(1, "鍚嶇О涓嶈兘涓虹┖"); + + record.setUpdateTime(new Date()); + if (record.getId() == null) { + record.setCreateTime(new Date()); + banLiShopGoodsClassMapper.insert(record); + } else { + BanLiShopGoodsClass resultObj = banLiShopGoodsClassMapper.selectByPrimaryKey(record.getId()); + if (resultObj == null) + throw new BanLiShopGoodsClassException(1, "淇敼鍐呭宸蹭笉瀛樺湪"); + + if (StringUtil.isNullOrEmpty(record.getPicture())) { + record.setPicture(resultObj.getPicture()); + } else if (!StringUtil.isNullOrEmpty(resultObj.getPicture())) { + COSManager.getInstance().deleteFile(resultObj.getPicture()); + } + record.setCreateTime(resultObj.getCreateTime()); + banLiShopGoodsClassMapper.updateByPrimaryKey(record); + } + } + + + @Override + public void delete(List<Long> idsList) { + if (idsList != null) + for (Long id : idsList) + banLiShopGoodsClassMapper.deleteByPrimaryKey(id); + + } +} -- Gitblit v1.8.0