| | |
| | | String productModel = row2.getCell(5).getStringCellValue(); |
| | | Row row3 = sheet.getRow(3); |
| | | String productVersion = row3.getCell(5).getStringCellValue(); |
| | | for (int l = 9; l < lastRowNum-1; l++) { |
| | | for (int l = 8; l < lastRowNum-1; l++) { |
| | | ProductBomApproving bomApproving = new ProductBomApproving(); |
| | | bomApproving.setParentModel(productModel); |
| | | bomApproving.setParentVersion(productVersion); |
| | |
| | | } |
| | | else if(m ==7){ |
| | | cellValueDouble = cell.getNumericCellValue(); |
| | | if(cellValueDouble.equals(0d)){ |
| | | cellValue = ""; |
| | | }else{ |
| | | cellValue = cellValueDouble.toString(); |
| | | } |
| | | } |
| | | else if(m==8){ |
| | | cellValueDouble = cell.getNumericCellValue(); |
| | | } |
| | | else { |
| | | cellValue = cell.getStringCellValue(); |
| | |
| | | case 3:{bomApproving.setSubCode(cellValue);}break; |
| | | case 4:{bomApproving.setSubName(cellValue);}break; |
| | | case 5:{ |
| | | /*bomApproving.setSubModel(cellValue); |
| | | //判断图纸查看是否存在 |
| | | bomApproving.setDwgExist(0); |
| | | String dwgFileName = cellValue+".dwg"; |
| | | for (int n = 0; n < dwgExistsList.size(); n++) { |
| | | FileUrlDTO fileUrlDTO = dwgExistsList.get(n); |
| | | if(dwgFileName.equals(fileUrlDTO.getFileName())){ |
| | | //存在 |
| | | bomApproving.setDwgExist(1); |
| | | bomApproving.setDwgUrl(fileUrlDTO.getHttpFileUrl()); |
| | | break; |
| | | } |
| | | }*/ |
| | | }break; |
| | | case 6:{bomApproving.setMaterial(cellValue);}break; |
| | | case 7:{bomApproving.setThickness(cellValue);}break; |
| | | case 8:{bomApproving.setQuantity(cellValueDouble.intValue());}break; |
| | | case 9:{bomApproving.setSurfaceDetail(cellValue);}break; |
| | | case 10:{bomApproving.setNotes(cellValue);}break; |
| | | case 11:{ |
| | | //图片,从0开始,到图片size为止 |
| | | int k = l-9; |
| | | if(k<allPictures.size()-1){ |
| | | PictureData pictureData = allPictures.get(k+1); |
| | | //图片存储 doc_file/product_approving/${username}/{dateFormat}/${timeStamp} |
| | | String suffix = pictureData.suggestFileExtension(); |
| | | String picturePath = filePath + File.separator + bomApproving.getSubModel() + "." + suffix; |
| | | String picturePathFront = "doc_file" + File.separator + "product_approving" + File.separator + user.getName() + File.separator + dateFormat + File.separator + timeStamp + File.separator + bomApproving.getSubModel() + "." + suffix; |
| | | byte[] data = pictureData.getData(); |
| | | FileOutputStream fileOutputStream = null; |
| | | File pictureFile = new File(picturePath); |
| | | fileOutputStream = new FileOutputStream(pictureFile); |
| | | fileOutputStream.write(data); |
| | | |
| | | bomApproving.setPictureUrl(picturePathFront); |
| | | } |
| | | }break; |
| | | } |
| | | } |
| | | list.add(bomApproving); |