From 51a4ff5d777028d52a19c314a99f796334cb7b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 23 十一月 2019 18:30:01 +0800 Subject: [PATCH] 配置文件修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java index 141e179..f22e70a 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java @@ -22,7 +22,7 @@ import com.yeshi.fanli.entity.bus.clazz.GoodsClass; import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass; import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass; -import com.yeshi.fanli.exception.GoodsClassException; +import com.yeshi.fanli.exception.goods.GoodsClassException; import com.yeshi.fanli.service.inter.goods.GoodsClassService; import com.yeshi.fanli.service.inter.goods.GoodsSubClassService; import com.yeshi.fanli.service.inter.goods.TaoBaoClassService; @@ -81,9 +81,9 @@ } @Override - public List<GoodsClass> listquery() throws Exception { + public List<GoodsClass> listquery(Integer sex) throws Exception { - List<GoodsClass> list = goodsClassMapper.getGoodsClassAll(); + List<GoodsClass> list = goodsClassMapper.getGoodsClassAll(sex); if (list != null && list.size() == 0) { return list; @@ -135,7 +135,7 @@ } public List<GoodsClass> getGoodsClassAll() { - return goodsClassMapper.getGoodsClassAll(); + return goodsClassMapper.getGoodsClassAll(null); } @Override @@ -146,7 +146,12 @@ if (name == null || name.trim().length() == 0) { throw new GoodsClassException(1, "鍒嗙被鍚嶇О涓嶈兘涓虹┖"); } - + + Integer sex = record.getSex(); + if (sex == null) { + throw new GoodsClassException(1, "鎬у埆璁剧疆涓嶈兘涓虹┖"); + } + // 鍥剧墖涓婁紶 String picture = null; if (file != null) { @@ -209,9 +214,16 @@ // 淇濆瓨娣樺疂鍟嗗搧鍒嗙被id String taobaoCids = record.getTaobaoCids(); + List<Long> tbCidList = new ArrayList<>(); if (!StringUtil.isNullOrEmpty(taobaoCids) && !"null".equalsIgnoreCase(taobaoCids)) { - taoBaoClassService.save(record.getId(), taobaoCids); + + String[] sts = taobaoCids.split(","); + for (String st : sts) { + String cid = st.split("-")[st.split("-").length - 1].trim(); + tbCidList.add(Long.parseLong(cid)); + } } + taoBaoClassService.save(record.getId(), tbCidList); } /** @@ -302,7 +314,7 @@ @Override @Cacheable(value = "classCache", key = "'getEffectiveClassCache'") - public List<GoodsClass> getEffectiveClassCache() throws Exception { + public List<GoodsClass> getEffectiveClassCache() { return goodsClassMapper.getEffectiveClass(); } -- Gitblit v1.8.0