| | |
| | | Cell cell = sheet.getRow(8 + i).getCell(2); |
| | | cell.setCellType(Cell.CELL_TYPE_STRING); |
| | | String stringCellValue = cell.getStringCellValue(); |
| | | int length = stringCellValue.length(); |
| | | if(length == 9){ |
| | | stringCellValue = "0"+stringCellValue; |
| | | }else if(length < 9){ |
| | | int centerZeroNum = 10 - length -1; |
| | | StringBuilder centerZeroStr = new StringBuilder(); |
| | | for (int j = 0; j < centerZeroNum; j++) { |
| | | centerZeroStr.append("0"); |
| | | if(!stringCellValue.equals("")) { |
| | | int length = stringCellValue.length(); |
| | | if (length == 9) { |
| | | stringCellValue = "0" + stringCellValue; |
| | | } else if (length < 9) { |
| | | int centerZeroNum = 10 - length - 1; |
| | | StringBuilder centerZeroStr = new StringBuilder(); |
| | | for (int j = 0; j < centerZeroNum; j++) { |
| | | centerZeroStr.append("0"); |
| | | } |
| | | String strFront = stringCellValue.substring(0, 3); |
| | | String strBehind = stringCellValue.substring(3); |
| | | stringCellValue = "0" + strFront + centerZeroStr + strBehind; |
| | | } |
| | | String strFront = stringCellValue.substring(0, 3); |
| | | String strBehind = stringCellValue.substring(3); |
| | | stringCellValue = "0"+strFront+centerZeroStr+strBehind; |
| | | } |
| | | software.setApplyMaterialCode(stringCellValue); |
| | | software.setApplyModel(sheet.getRow(8+i).getCell(4).getStringCellValue()); |