|
|
@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
import cn.hutool.core.util.ReflectUtil; |
|
|
|
import cn.hutool.core.util.ReflectUtil; |
|
|
|
import cn.hutool.core.util.ZipUtil; |
|
|
|
import cn.hutool.core.util.ZipUtil; |
|
|
|
|
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
import com.keyware.shandan.bianmu.service.DataLabelsService; |
|
|
|
import com.keyware.shandan.bianmu.service.DataLabelsService; |
|
|
|
import com.keyware.shandan.common.controller.BaseController; |
|
|
|
import com.keyware.shandan.common.controller.BaseController; |
|
|
|
import com.keyware.shandan.common.entity.Result; |
|
|
|
import com.keyware.shandan.common.entity.Result; |
|
|
@ -29,6 +30,10 @@ import org.springframework.web.servlet.ModelAndView; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.net.HttpURLConnection; |
|
|
|
|
|
|
|
import java.net.MalformedURLException; |
|
|
|
|
|
|
|
import java.net.URL; |
|
|
|
|
|
|
|
import java.net.URLConnection; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
@ -120,22 +125,6 @@ public class SysFileController extends BaseController<SysFileService, SysFile, S |
|
|
|
} |
|
|
|
} |
|
|
|
mav.addObject("readableFileSize", fileSize); |
|
|
|
mav.addObject("readableFileSize", fileSize); |
|
|
|
mav.addObject("LabelConfigSet", labelsService.formConfigList()); |
|
|
|
mav.addObject("LabelConfigSet", labelsService.formConfigList()); |
|
|
|
File ff = new File(customProperties.getFileStorage().getPath() + File.separator + file.getPath()); |
|
|
|
|
|
|
|
if (!ff.exists()) { |
|
|
|
|
|
|
|
mav.addObject("fileNotExists", true); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (PoiFileReadUtil.isReadilyFile(ff)) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
String text = PoiFileReadUtil.parseTextByFile(ff); |
|
|
|
|
|
|
|
if (text == null) { |
|
|
|
|
|
|
|
mav.addObject("fileReadError", true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
mav.addObject("fileReadError", true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return mav; |
|
|
|
return mav; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|