|
|
@@ -9,6 +9,9 @@ import java.util.Date;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
@@ -269,12 +272,19 @@ public class FundManagerOrderApiController extends CertifyApiController {
|
|
|
*/
|
|
|
@RequestMapping(value="/exportBillData", method = RequestMethod.GET)
|
|
|
public Result exportBillData(TOrderBillNew billNew,HttpServletResponse response) throws IOException{
|
|
|
+ OutputStream out = response.getOutputStream();
|
|
|
Result res = new Result();
|
|
|
HSSFWorkbook wb = orderBillServiceImpl.exportBillData(billNew);
|
|
|
if(null == wb){
|
|
|
- res.getError().add(buildError("", "没有流水记录!"));
|
|
|
- return res;
|
|
|
+ wb = new HSSFWorkbook();
|
|
|
+ HSSFSheet sheet = wb.createSheet("没有流水记录");
|
|
|
+ HSSFRow row = sheet.createRow(0);
|
|
|
+ HSSFCell cell = row.createCell(0);
|
|
|
+ cell.setCellValue("没有流水记录");
|
|
|
}
|
|
|
+ String fileName = "部门流水" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
|
|
|
+ response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(),"iso-8859-1"));
|
|
|
+ response.setContentType("application/octet-stream;charset=utf-8");
|
|
|
/*String fileName = "部门流水" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
|
|
|
ExportExcelUtil.download(path,response,fileName);
|
|
|
res.setData(path);
|
|
|
@@ -284,20 +294,17 @@ public class FundManagerOrderApiController extends CertifyApiController {
|
|
|
System.out.println("shanchu----------------------0");
|
|
|
f.delete();
|
|
|
}*/
|
|
|
- String fileName = "部门流水" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
|
|
|
- OutputStream out = response.getOutputStream();
|
|
|
- response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(),"iso-8859-1"));
|
|
|
- response.setContentType("application/octet-stream;charset=utf-8");
|
|
|
try {
|
|
|
// 返回数据流
|
|
|
- wb.write(out);
|
|
|
+ wb.write(out);
|
|
|
out.flush();
|
|
|
out.close();
|
|
|
} finally {
|
|
|
- out.flush();
|
|
|
- out.close();
|
|
|
+ out.flush();
|
|
|
+ out.close();
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|