| | |
| | | import com.whyc.pojo.Software; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.WorkbookFactory; |
| | |
| | | import java.io.*; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | for (int i = 0; i < typeArr.length; i++) { |
| | | //excel单元格中的✔对应字符 |
| | | if(typeArr[i].contains("þ")){ |
| | | common.setType(typeArr[i].trim()); |
| | | common.setType(typeArr[i].replace("þ","").trim()); |
| | | break; |
| | | } |
| | | } |
| | |
| | | common.setBasedVersion(sheet.getRow(4).getCell(4).getStringCellValue()); |
| | | |
| | | common.setOwner(sheet.getRow(5).getCell(2).getStringCellValue()); |
| | | Date filingDate = sheet.getRow(5).getCell(4).getDateCellValue(); |
| | | common.setFilingDate(filingDate); |
| | | common.setFilingDate(sheet.getRow(5).getCell(4).getStringCellValue()); |
| | | //最后一行,取发布说明 |
| | | common.setReleaseNotes(sheet.getRow(lastRowNum).getCell(2).getStringCellValue()); |
| | | |
| | |
| | | Software software = new Software(); |
| | | BeanUtils.copyProperties(common,software); |
| | | //取第3列,第5列 |
| | | software.setApplyMaterialCode(sheet.getRow(8+i).getCell(2).getStringCellValue()); |
| | | software.setApplyModel(sheet.getRow(8+i).getCell(4).getStringCellValue()); |
| | | Cell cell = sheet.getRow(7 + i).getCell(2); |
| | | cell.setCellType(Cell.CELL_TYPE_STRING); |
| | | software.setApplyMaterialCode(cell.getStringCellValue()); |
| | | software.setApplyModel(sheet.getRow(7+i).getCell(4).getStringCellValue()); |
| | | |
| | | softwareList.add(software); |
| | | } |