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/goods/TaoBaoClassServiceImpl.java | 226 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 113 insertions(+), 113 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoClassServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoClassServiceImpl.java index 26157ba..13cbda5 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoClassServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoClassServiceImpl.java @@ -1,113 +1,113 @@ -package com.yeshi.fanli.service.impl.goods; - -import java.util.ArrayList; -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.TaoBaoClassMapper; -import com.yeshi.fanli.dao.mybatis.TaoBaoClassRelationMapper; -import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass; -import com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation; -import com.yeshi.fanli.service.inter.goods.TaoBaoClassService; -import com.yeshi.fanli.util.StringUtil; - -@Service -public class TaoBaoClassServiceImpl implements TaoBaoClassService { - - @Resource - private TaoBaoClassMapper taoBaoClassMapper; - - @Resource - private TaoBaoClassRelationMapper taoBaoClassRelationMapper; - - @Override - public List<TaoBaoClass> listBySystemCid(long start, int count, Long systemCid) { - return taoBaoClassMapper.listBySystemCid(start, count, systemCid); - } - - @Override - public String getTaoBaoCatIds(Long classId) { - List<TaoBaoClass> listCatIds = listBySystemCid(0, 10, classId); - if (listCatIds == null || listCatIds.size() == 0) { - return null; - } - - String taobaoCatIds = ""; - for (TaoBaoClass taoBaoClass : listCatIds) { - Integer categoryId = taoBaoClass.getCategoryId(); - - if (categoryId == null) { - continue; - } - taobaoCatIds += categoryId + ","; - } - - if (!StringUtil.isNullOrEmpty(taobaoCatIds)) { - taobaoCatIds = taobaoCatIds.substring(0, taobaoCatIds.length() - 1); - } - return taobaoCatIds; - } - - @Override - public TaoBaoClass getByCategoryId(Integer categoryId) { - return taoBaoClassMapper.getByCategoryId(categoryId); - } - - @Override - @Transactional - public void save(Long classId, List<Long> taobaoCids) { - if (taobaoCids == null) { - return; - } - - // 鍒犻櫎涔嬪墠鐨勶紝鎻掑叆鐜板湪鐨� - taoBaoClassRelationMapper.deleteByCid(classId); - for (Long categoryId : taobaoCids) { - TaoBaoClass taoBaoClass = taoBaoClassMapper.getByCategoryId(Integer.parseInt(categoryId + "")); - if (taoBaoClass == null) - continue; - TaoBaoClassRelation relation = new TaoBaoClassRelation(); - relation.setCid(classId); - relation.setTaobaoCid(taoBaoClass.getId()); - relation.setCreatetime(new Date()); - relation.setUpdatetime(new Date()); - relation.setWeight(0.0); - taoBaoClassRelationMapper.insertSelective(relation); - } - } - - @Transactional - @Override - public void saveSub(Long subClassId, List<Long> taobaoCids) { - if (taobaoCids == null) { - return; - } - - // 鍒犻櫎涔嬪墠鐨勶紝鎻掑叆鐜板湪鐨� - taoBaoClassRelationMapper.deleteBySubId(subClassId); - for (Long categoryId : taobaoCids) { - TaoBaoClass taoBaoClass = taoBaoClassMapper.getByCategoryId(Integer.parseInt(categoryId + "")); - if (taoBaoClass == null) - continue; - TaoBaoClassRelation relation = new TaoBaoClassRelation(); - relation.setSubId(subClassId); - relation.setTaobaoCid(taoBaoClass.getId()); - relation.setCreatetime(new Date()); - relation.setUpdatetime(new Date()); - relation.setWeight(0.0); - taoBaoClassRelationMapper.insertSelective(relation); - } - } - - @Override - public List<TaoBaoClass> listBySystemSubCid(long start, int count, Long systemSubCid) { - - return taoBaoClassMapper.listBySystemSubCid(start, count, systemSubCid); - } - -} +package com.yeshi.fanli.service.impl.goods; + +import java.util.ArrayList; +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.TaoBaoClassMapper; +import com.yeshi.fanli.dao.mybatis.TaoBaoClassRelationMapper; +import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass; +import com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation; +import com.yeshi.fanli.service.inter.goods.TaoBaoClassService; +import com.yeshi.fanli.util.StringUtil; + +@Service +public class TaoBaoClassServiceImpl implements TaoBaoClassService { + + @Resource + private TaoBaoClassMapper taoBaoClassMapper; + + @Resource + private TaoBaoClassRelationMapper taoBaoClassRelationMapper; + + @Override + public List<TaoBaoClass> listBySystemCid(long start, int count, Long systemCid) { + return taoBaoClassMapper.listBySystemCid(start, count, systemCid); + } + + @Override + public String getTaoBaoCatIds(Long classId) { + List<TaoBaoClass> listCatIds = listBySystemCid(0, 10, classId); + if (listCatIds == null || listCatIds.size() == 0) { + return null; + } + + String taobaoCatIds = ""; + for (TaoBaoClass taoBaoClass : listCatIds) { + Integer categoryId = taoBaoClass.getCategoryId(); + + if (categoryId == null) { + continue; + } + taobaoCatIds += categoryId + ","; + } + + if (!StringUtil.isNullOrEmpty(taobaoCatIds)) { + taobaoCatIds = taobaoCatIds.substring(0, taobaoCatIds.length() - 1); + } + return taobaoCatIds; + } + + @Override + public TaoBaoClass getByCategoryId(Integer categoryId) { + return taoBaoClassMapper.getByCategoryId(categoryId); + } + + @Override + @Transactional + public void save(Long classId, List<Long> taobaoCids) { + if (taobaoCids == null) { + return; + } + + // 鍒犻櫎涔嬪墠鐨勶紝鎻掑叆鐜板湪鐨� + taoBaoClassRelationMapper.deleteByCid(classId); + for (Long categoryId : taobaoCids) { + TaoBaoClass taoBaoClass = taoBaoClassMapper.getByCategoryId(Integer.parseInt(categoryId + "")); + if (taoBaoClass == null) + continue; + TaoBaoClassRelation relation = new TaoBaoClassRelation(); + relation.setCid(classId); + relation.setTaobaoCid(taoBaoClass.getId()); + relation.setCreatetime(new Date()); + relation.setUpdatetime(new Date()); + relation.setWeight(0.0); + taoBaoClassRelationMapper.insertSelective(relation); + } + } + + @Transactional + @Override + public void saveSub(Long subClassId, List<Long> taobaoCids) { + if (taobaoCids == null) { + return; + } + + // 鍒犻櫎涔嬪墠鐨勶紝鎻掑叆鐜板湪鐨� + taoBaoClassRelationMapper.deleteBySubId(subClassId); + for (Long categoryId : taobaoCids) { + TaoBaoClass taoBaoClass = taoBaoClassMapper.getByCategoryId(Integer.parseInt(categoryId + "")); + if (taoBaoClass == null) + continue; + TaoBaoClassRelation relation = new TaoBaoClassRelation(); + relation.setSubId(subClassId); + relation.setTaobaoCid(taoBaoClass.getId()); + relation.setCreatetime(new Date()); + relation.setUpdatetime(new Date()); + relation.setWeight(0.0); + taoBaoClassRelationMapper.insertSelective(relation); + } + } + + @Override + public List<TaoBaoClass> listBySystemSubCid(long start, int count, Long systemSubCid) { + + return taoBaoClassMapper.listBySystemSubCid(start, count, systemSubCid); + } + +} -- Gitblit v1.8.0