| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.gkhy.assess.common.exception.ApiException; |
| | | import com.gkhy.assess.system.excel.ExpertExcelListener; |
| | | import com.gkhy.assess.system.domain.vo.SysExpertInfoExcelVO; |
| | | import com.gkhy.assess.system.domain.vo.UploadObjectVO; |
| | | import com.gkhy.assess.system.service.SysCommonService; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.core.io.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import sun.misc.BASE64Decoder; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void importExcel() throws IOException { |
| | | ClassPathResource classPathResource = new ClassPathResource("abc.xlsx"); |
| | | InputStream inputStream = classPathResource.getInputStream(); |
| | | if(inputStream==null){ |
| | | throw new ApiException("获取文件失败"); |
| | | } |
| | | EasyExcel.read(inputStream, SysExpertInfoExcelVO.class,new ExpertExcelListener()).sheet(0).doRead(); |
| | | } |
| | | |
| | | @Override |
| | | public UploadObjectVO doUpload(MultipartFile file){ |
| | | String originName=file.getOriginalFilename(); |
| | | String filename=originName; |