|
@@ -1,6 +1,8 @@
|
|
|
package com.diagbot.util;
|
|
|
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
@@ -122,27 +124,25 @@ public class ExportBeanExcelUtil<T> {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- RespDTO resultMode = new RespDTO();
|
|
|
try {
|
|
|
-
|
|
|
-
|
|
|
FileOutputStream exportXls = new FileOutputStream(lujing + fileName + ".xls");
|
|
|
wb.write(exportXls);
|
|
|
exportXls.close();
|
|
|
/* resultMode.setResult(true);
|
|
|
resultMode.setMessage(MSG_SUCCESS);*/
|
|
|
- return resultMode.onSuc(MSG_SUCCESS);
|
|
|
+ return RespDTO.onSuc(MSG_SUCCESS);
|
|
|
} catch (FileNotFoundException e) {
|
|
|
/* System.out.println("导出失败!");
|
|
|
resultMode.setResult(false);
|
|
|
resultMode.setMessage(MSG_ERROR);*/
|
|
|
e.printStackTrace();
|
|
|
- return resultMode.onSuc(MSG_ERROR);
|
|
|
-
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "导出失败");
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
- return resultMode.onSuc(MSG_ERROR);
|
|
|
-
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "导出失败");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "导出失败");
|
|
|
}
|
|
|
|
|
|
// return resultMode;
|