yujian
2019-05-14 8cb7ec4a35a38ae91d0eed17cde711e81d2b2bbf
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java
@@ -18,7 +18,9 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabelMap;
import com.yeshi.fanli.exception.GoodsSubClassException;
import com.yeshi.fanli.service.inter.clazz.GoodsSubClassLabelService;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
@@ -37,6 +39,9 @@
   @Resource
   private TaoBaoClassService taoBaoClassService;
   @Resource
   private GoodsSubClassLabelService goodsSubClassLabelService;
   @Override
   public int deleteByPrimaryKey(Long id) {
@@ -123,8 +128,8 @@
   }
   @Override
   public void saveObject(MultipartFile file, MultipartFile file2, GoodsSubClass record, Integer type, Long pid)
         throws GoodsSubClassException, Exception {
   public void saveObject(MultipartFile file, MultipartFile file2, GoodsSubClass record, Integer type, Long pid,
         GoodsSubClassLabelMap labelMap) throws GoodsSubClassException, Exception {
      String name = record.getName();
      if (name == null || name.trim().length() == 0) {
@@ -196,6 +201,11 @@
         }
         goodsSubClassMapper.insert(record);
         if (labelMap != null) {
            labelMap.setCreateTime(new Date());
            labelMap.setGoodsSubClass(record);
            goodsSubClassLabelService.addSubClassLabelMap(labelMap);
         }
      } else {
         // 修改
@@ -232,6 +242,12 @@
         record.setCreatetime(resultObj.getCreatetime());
         record.setUpdatetime(new Date());
         goodsSubClassMapper.updateByPrimaryKey(record);
         if (labelMap != null) {
            labelMap.setCreateTime(new Date());
            labelMap.setGoodsSubClass(record);
            goodsSubClassLabelService.addSubClassLabelMap(labelMap);
         }
      }
      // 保存淘宝商品分类id