Buggy code:
@ Controller public class ExportController { private static Logger logger = LoggerFactory . getLogger ( ExportController . class ) ; @ Autowired private ClothService clothService ; @ Autowired private ClothMaterialService clothMaterialService ; @ Autowired private ClothColorService clothColorService ; @ Autowired private ClothSizeService clothSizeService ; @ Autowired private OrderClothService orderClothService ; @ RequestMapping ( value = { "//Manager//ExportMaterialExcel" , "//Proofing//ExportMaterialExcel" } , method = RequestMethod . GET ) public void exportMaterial ( HttpServletRequest request , HttpServletResponse response ) throws IOException { } @ RequestMapping ( value = { "//Manager//ExportPriceExcel" , "//Pricing//ExportPriceExcel" } , method = RequestMethod . GET ) public void exportPrice ( HttpServletRequest request , HttpServletResponse response ) throws IOException { } @ RequestMapping ( value = { "//Manager//ExportCountExcel" , "//Buyer//ExportCountExcel" } , method = RequestMethod . GET ) public void exportCount ( HttpServletRequest request , HttpServletResponse response ) throws IOException { } @ SuppressWarnings ( "deprecation" ) @ RequestMapping ( value = { "//Manager//ExportRecordItems" , "//Proofing//ExportRecordItems" } , method = RequestMethod . GET ) public void exportRecordItems ( HttpServletRequest request , HttpServletResponse response ) throws IOException { } @ SuppressWarnings ( "deprecation" ) private void exportClothCountSheet ( Workbook workbook , String sheetTitle , Cloth cloth , ClothOrderDetailData clothOrder , List < ClothSize > clothSizes , List < ClothMaterialDetailData > leatherList , List < ClothMaterialDetailData > fabricList , List < ClothMaterialDetailData > supportList ) { } private void exportClothMaterialSheet ( Workbook workbook , String sheetTitle , Cloth cloth , List < ClothMaterialDetailData > leatherList , List < ClothMaterialDetailData > fabricList , List < ClothMaterialDetailData > supportList ) { <START_BUG> String [ ] columnNames = new String [ ] { "项目" , "部位" , "单位" , "用量" , "数量" , "订购数量" , "单价" , "金额" , "订购日期" , "备注" } ; <END_BUG> String [ ] [ ] leatherData = getMaterialTableData ( leatherList , columnNames . length ) ; String [ ] [ ] fabricData = getMaterialTableData ( fabricList , columnNames . length ) ; String [ ] [ ] supportData = getMaterialTableData ( supportList , columnNames . length ) ; Sheet sheet = null ; Row row = null ; Cell cell = null ; CellStyle style = null ; CellStyle colorStyle = null ; if ( workbook instanceof HSSFWorkbook ) { HSSFColor lightGray = setColor ( ( ( HSSFWorkbook ) ( workbook ) ) , ( ( byte ) ( 224 ) ) , ( ( byte ) ( 224 ) ) , ( ( byte ) ( 224 ) ) ) ; colorStyle = workbook . createCellStyle ( ) ; colorStyle . setFillForegroundColor ( lightGray . getIndex ( ) ) ; colorStyle . setFillPattern ( SOLID_FOREGROUND ) ; } style = workbook . createCellStyle ( ) ; style . setAlignment ( ALIGN_CENTER ) ; sheet = workbook . createSheet ( sheetTitle ) ; int rowIndex = 0 ; row = sheet . createRow ( rowIndex ) ; cell = row . createCell ( 0 ) ; cell . setCellValue ( "款号" ) ; cell = row . createCell ( 1 ) ; cell . setCellValue ( cloth . getType ( ) ) ; rowIndex ++ ; row = sheet . createRow ( rowIndex ) ; cell = row . createCell ( 0 ) ; cell . setCellValue ( "款名" ) ; cell = row . createCell ( 1 ) ; cell . setCellValue ( cloth . getName ( ) ) ; rowIndex ++ ; row = sheet . createRow ( rowIndex ) ; for ( int i = 0 ; i < ( columnNames . length ) ; i ++ ) { cell = row . createCell ( i ) ; cell . setCellValue ( columnNames [ i ] ) ; cell . setCellStyle ( style ) ; } rowIndex ++ ; row = sheet . createRow ( rowIndex ) ; cell = row . createCell ( 0 ) ; cell . setCellValue ( "皮料小计" ) ; cell . setCellStyle ( colorStyle ) ; rowIndex ++ ; if ( null != leatherData ) { int startIndex = rowIndex ; int endIndex = rowIndex + ( leatherData . length ) ; for ( int i = startIndex ; i < endIndex ; i ++ , rowIndex ++ ) { row = sheet . createRow ( rowIndex ) ; int dataRowIndex = i - startIndex ; for ( int j = 0 ; j < ( leatherData [ dataRowIndex ] . length ) ; j ++ ) { cell = row . createCell ( j ) ; cell . setCellValue ( leatherData [ dataRowIndex ] [ j ] ) ; cell . setCellStyle ( style ) ; } } } else { row = sheet . createRow ( rowIndex ) ; cell = row . createCell ( 0 ) ; cell . setCellValue ( "暂无数据" ) ; rowIndex ++ ; } row = sheet . createRow ( rowIndex ) ; cell = row . createCell ( 0 ) ; cell . setCellValue ( "面料小计" ) ; cell . setCellStyle ( colorStyle ) ; rowIndex ++ ; if ( null != fabricData ) { int startIndex = rowIndex ; int endIndex = rowIndex + ( fabricData . length ) ; for ( int i = startIndex ; i < endIndex ; i ++ , rowIndex ++ ) { row = sheet . createRow ( rowIndex ) ; int dataRowIndex = i - startIndex ; for ( int j = 0 ; j < ( fabricData [ dataRowIndex ] . length ) ; j ++ ) { cell = row . createCell ( j ) ; cell . setCellValue ( fabricData [ dataRowIndex ] [ j ] ) ; cell . setCellStyle ( style ) ; } } } else { row = sheet . createRow ( rowIndex ) ; cell = row . createCell ( 0 ) ; cell . setCellValue ( "暂无数据" ) ; rowIndex ++ ; } row = sheet . createRow ( rowIndex ) ; cell = row . createCell ( 0 ) ;

Fix:
String [ ] columnNames = new String [ ] { "项目" , "部位" , "单位" , "用量" , "数量" , "订购数量" , "单价" , "金额" , "订购日期" , "备注" , "需要解决的问题" , "交货期" } ;