admin
2020-06-10 271ae63c20fcbe28d29c47f1881138ff6551a2a1
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/LabelServiceImpl.java
@@ -25,6 +25,7 @@
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.exception.goods.quality.LabelException;
import com.yeshi.fanli.service.inter.lable.LabelService;
import com.yeshi.fanli.util.FilePathEnum;
import com.yeshi.fanli.util.StringUtil;
import jxl.Sheet;
@@ -49,7 +50,7 @@
   }
   @Override
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public void insertList(List<Label>  records,AdminUser admin) throws LabelException{
      if (records != null && records.size() > 0) {
         for (Label label : records) {
@@ -96,7 +97,7 @@
   }
   
   @Override
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public void updateList(List<Label>  records) throws LabelException{
      if (records != null && records.size() > 0) {
         for (Label label : records) {
@@ -125,13 +126,13 @@
   
   @Override
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public int deleteBatchById(long[] ids) throws LabelException{
      return labelMapper.deleteBatchByPrimaryKey(ids);
   }
   @Override
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public void deleteBatchByPrimaryKey(List<Long> ids) throws LabelException {
      for (Long id : ids) {
         Label label = labelMapper.selectByPrimaryKey(id);
@@ -245,7 +246,7 @@
      String contentType = file.getContentType();
      String type = contentType.substring(contentType.indexOf("/") + 1);
      // 上传文件相对位置
      String fileUrl="LableImg/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
      String fileUrl=FilePathEnum.lable.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type;
      
      boolean deleteFile =true;