| | |
| | | //取第三行,并以第三行开始 |
| | | Row row2 = sheet.getRow(1); |
| | | short lastCellNum = row2.getLastCellNum(); |
| | | for (int i = 2; i < lastRowNum; i++) { |
| | | for (int i = 2; i < lastRowNum+1; i++) { |
| | | ProductBomApproving bomApproving = new ProductBomApproving(); |
| | | for (int j = 1; j < lastCellNum; j++) { |
| | | Row row = sheet.getRow(i); |
| | |
| | | provingFile.mkdirs(); |
| | | } |
| | | String suffix = pictureData.suggestFileExtension(); |
| | | String picturePath = approvingPath + File.separator + bomApproving.getSubModel() + File.separator + suffix; |
| | | String picturePath = approvingPath + File.separator + bomApproving.getSubModel() + "." + suffix; |
| | | String picturePathFront = "doc_file" + File.separator + "product_approving" + File.separator + user.getName() + File.separator + dateFormat + File.separator + bomApproving.getSubModel() + "." + suffix; |
| | | byte[] data = pictureData.getData(); |
| | | FileOutputStream fileOutputStream = null; |
| | | try { |
| | | File pictureFile = new File(picturePath); |
| | | fileOutputStream = new FileOutputStream(pictureFile); |
| | | fileOutputStream.write(data); |
| | | }finally { |
| | | fileOutputStream.close(); |
| | | } |
| | | bomApproving.setPictureUrl(picturePath); |
| | | File pictureFile = new File(picturePath); |
| | | fileOutputStream = new FileOutputStream(pictureFile); |
| | | fileOutputStream.write(data); |
| | | |
| | | bomApproving.setPictureUrl(picturePathFront); |
| | | } |
| | | }break; |
| | | } |