| | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.chinaztt.mes.docx.dto.GetFileDto; |
| | | import com.chinaztt.mes.docx.dto.ThicknessData; |
| | | import com.chinaztt.mes.docx.service.DocxService; |
| | | import com.chinaztt.mes.docx.util.R; |
| | | import com.chinaztt.mes.docx.util.TakeWords; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.*; |
| | | import java.sql.SQLException; |
| | | import java.sql.*; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | switch (getFileDto.getFileExtension()) { |
| | | case ".docx": |
| | | return R.ok(TakeWords.readWordFile(file)); |
| | | //后缀为.xls的文件 |
| | | case ".xls": |
| | | return R.ok(TakeWords.readExcelxlsFile(file)); |
| | | case ".xlsx": |
| | | try { |
| | | return R.ok(TakeWords.readExcelFile(file)); |
| | |
| | | if (ObjectUtil.isEmpty(getFileDto.getDbFileName()) || Objects.equals(getFileDto.getDbFileName(), "null")) { |
| | | return R.failed("未配置.db采集文件名称!"); |
| | | } |
| | | return R.ok(TakeWords.readDbFile(file, getFileDto)); |
| | | return R.ok(TakeWords.getmysqlFile(getFileDto)); |
| | | case ".png": |
| | | return R.ok(TakeWords.readPngFile(file)); |
| | | default: |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public static File getLatestFile(List<File> files) { |
| | | File latestFile = null; |
| | | long latestTime = 0; |