yujian
2019-08-27 d8359ddb48dab5cc797a9d552e11fde571f4920c
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java
@@ -73,7 +73,7 @@
   @Transactional
   public void deleteByRootId(Long id) throws Exception {
      List<GoodsSubClass> subClassList = goodsSubClassMapper.queryByRootId(id, null);
      List<GoodsSubClass> subClassList = goodsSubClassMapper.queryByRootId(id, null, null);
      if (subClassList != null && subClassList.size() > 0) {
         for (GoodsSubClass goodsSubClass : subClassList) {
            deleteSub(goodsSubClass.getId());
@@ -136,6 +136,9 @@
      if (name == null || name.trim().length() == 0) {
         throw new GoodsSubClassException(1, "分类名称不能为空");
      }
      if (StringUtil.isNullOrEmpty(record.getMonth()))
         record.setMonth(null);
      // 图片上传
      String picture = null;
@@ -204,7 +207,7 @@
         }
         goodsSubClassMapper.insert(record);
         if (labelId != null) {
            GoodsSubClassLabelMap map = new GoodsSubClassLabelMap();
            map.setGoodsSubClass(record);
@@ -250,7 +253,10 @@
            GoodsSubClassLabelMap map = new GoodsSubClassLabelMap();
            map.setGoodsSubClass(record);
            map.setLabel(new GoodsSubClassLabel(labelId));
            goodsSubClassLabelService.addSubClassLabelMap(map);
            try {
               goodsSubClassLabelService.addSubClassLabelMap(map);
            } catch (Exception e) {
            }
         }
         goodsSubClassMapper.updateByPrimaryKey(record);
@@ -332,7 +338,7 @@
   @Override
   public List<GoodsSubClass> queryByRootId(Long rootId, Integer state) throws Exception {
      return goodsSubClassMapper.queryByRootId(rootId, state);
      return goodsSubClassMapper.queryByRootId(rootId, state, null);
   }
   @Override
@@ -351,14 +357,14 @@
   }
   @Override
   public List<GoodsSubClass> getGoodsSecondClass(Long rootId, Integer state) throws Exception {
      return goodsSubClassMapper.queryByRootId(rootId, state);
   public List<GoodsSubClass> getGoodsSecondClass(Long rootId, Integer state, Integer month) throws Exception {
      return goodsSubClassMapper.queryByRootId(rootId, state, month);
   }
   @Override
   @Cacheable(value = "classCache", key = "'getSubClassCache-'+#rootId +'-'+#state")
   public List<GoodsSubClass> getSubClassCache(Long rootId, Integer state) throws Exception {
      return getGoodsSecondClass(rootId, state);
   public List<GoodsSubClass> getSubClassCache(Long rootId, Integer state, Integer month) throws Exception {
      return getGoodsSecondClass(rootId, state, month);
   }
   @Override