| | |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.FileUtils; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.xml.bind.DatatypeConverter; |
| | |
| | | Boolean isOldDuo = false; |
| | | StringBuffer sb = new StringBuffer(); |
| | | if (answerContentVOList != null && answerContentVOList.size() > 0) { |
| | | int a=0; |
| | | for (ComActQuestnaireAnswerContentVO userAnswers : answerContentVOList) { |
| | | a++; |
| | | if(answerContentVOList.size()==26&&a==9){ |
| | | userData.add(" "); |
| | | } |
| | | //判断是文字描述直接跳过 |
| | | if (userAnswers.getOptionType().equals(5) || userAnswers.getOptionType().equals(11) |
| | | || (StringUtils.isNotEmpty(userAnswers.getAnswerContent()) && userAnswers.getAnswerContent().contains(noExport))) { |
| | |
| | | resultList.add(userData); |
| | | } |
| | | return resultList; |
| | | } |
| | | |
| | | public static File createTmpFile(InputStream inputStream, String name, String ext, File tmpDirFile) throws IOException { |
| | | File resultFile = File.createTempFile(name, '.' + ext, tmpDirFile); |
| | | resultFile.deleteOnExit(); |
| | | FileUtils.copyToFile(inputStream, resultFile); |
| | | return resultFile; |
| | | } |
| | | |
| | | public static File bytesToFile(byte[] bytes, String fileType) throws IOException { |
| | | return createTmpFile(new ByteArrayInputStream(bytes), |
| | | UUID.randomUUID().toString(), |
| | | fileType, |
| | | Files.createTempDirectory("tempFile").toFile()); |
| | | } |
| | | } |