|
@@ -18,6 +18,7 @@ import org.apache.struts2.interceptor.ServletRequestAware;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Vector;
|
|
import java.util.Vector;
|
|
|
|
|
|
|
@@ -165,21 +166,35 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
s1.append(" and pay_time >= '").append(payStartTime).append("'")
|
|
s1.append(" and pay_time >= '").append(payStartTime).append("'")
|
|
|
.append(" and pay_time <= '").append(payEndTime).append("'");
|
|
.append(" and pay_time <= '").append(payEndTime).append("'");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
List<Booking> list = bookService.queryList(s1.toString()); // 查询分页
|
|
List<Booking> list = bookService.queryList(s1.toString()); // 查询分页
|
|
|
|
|
+ List<Vector> vectorsList = new ArrayList<>();
|
|
|
|
|
+ for(Booking book:list){
|
|
|
|
|
+ Vector columnValue = new Vector();
|
|
|
|
|
+ columnValue.add(book.getOrderNum());
|
|
|
|
|
+ columnValue.add(book.getOrderName());
|
|
|
|
|
+ columnValue.add(book.getUserName());
|
|
|
|
|
+ columnValue.add(book.getUserPhone());
|
|
|
|
|
+ columnValue.add(book.getHouseName());
|
|
|
|
|
+ columnValue.add(book.getHouseOrderNumber());
|
|
|
|
|
+ columnValue.add(book.getHouseTotalPrice());
|
|
|
|
|
+ columnValue.add(book.getPayTime());
|
|
|
|
|
+ }
|
|
|
// 项目路径地址
|
|
// 项目路径地址
|
|
|
String path = request.getSession().getServletContext()
|
|
String path = request.getSession().getServletContext()
|
|
|
.getRealPath("/download/");// File.separator
|
|
.getRealPath("/download/");// File.separator
|
|
|
try{
|
|
try{
|
|
|
Vector columnName = new Vector();
|
|
Vector columnName = new Vector();
|
|
|
- columnName.add("orderNum");
|
|
|
|
|
- columnName.add("orderName");
|
|
|
|
|
- columnName.add("userName");
|
|
|
|
|
- columnName.add("userPhone");
|
|
|
|
|
- columnName.add("houseName");
|
|
|
|
|
- columnName.add("houseTotalPrice");
|
|
|
|
|
- columnName.add("payTime");
|
|
|
|
|
|
|
+ columnName.add("订单号");
|
|
|
|
|
+ columnName.add("状态");
|
|
|
|
|
+ columnName.add("预定人");
|
|
|
|
|
+ columnName.add("手机号");
|
|
|
|
|
+ columnName.add("预定房型");
|
|
|
|
|
+ columnName.add("房间数");
|
|
|
|
|
+ columnName.add("订单金额(元)");
|
|
|
|
|
+ columnName.add("支付时间");
|
|
|
// 导出文件
|
|
// 导出文件
|
|
|
- new toExcel().book(list, path + "订单信息" + "Report.xls",
|
|
|
|
|
|
|
+ new toExcel().book(vectorsList, path + "订单信息" + UUIDUtil.generateID() +"Report.xls",
|
|
|
"sheet1", columnName);
|
|
"sheet1", columnName);
|
|
|
String url = request.getSession().getServletContext().getContextPath();
|
|
String url = request.getSession().getServletContext().getContextPath();
|
|
|
resultJson.put("downurl", url+"/download/订单信息" + "Report.xls");
|
|
resultJson.put("downurl", url+"/download/订单信息" + "Report.xls");
|
|
@@ -293,20 +308,30 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Booking> list = bookService.queryList(s1.toString()); // 查询列表
|
|
List<Booking> list = bookService.queryList(s1.toString()); // 查询列表
|
|
|
|
|
+ List<Vector> vectorsList = new ArrayList<>();
|
|
|
|
|
+ for(Booking book:list){
|
|
|
|
|
+ Vector columnValue = new Vector();
|
|
|
|
|
+ columnValue.add(book.getOrderNum());
|
|
|
|
|
+ columnValue.add(book.getUserName());
|
|
|
|
|
+ columnValue.add(book.getUserPhone());
|
|
|
|
|
+ columnValue.add(book.getHouseOrderNumber());
|
|
|
|
|
+ columnValue.add(book.getPayAccount());
|
|
|
|
|
+ columnValue.add(book.getPayTime());
|
|
|
|
|
+ }
|
|
|
// 项目路径地址
|
|
// 项目路径地址
|
|
|
String path = request.getSession().getServletContext()
|
|
String path = request.getSession().getServletContext()
|
|
|
.getRealPath("/download/");// File.separator
|
|
.getRealPath("/download/");// File.separator
|
|
|
|
|
|
|
|
try{
|
|
try{
|
|
|
Vector columnName = new Vector();
|
|
Vector columnName = new Vector();
|
|
|
- columnName.add("orderNum");
|
|
|
|
|
- columnName.add("userName");
|
|
|
|
|
- columnName.add("userPhone");
|
|
|
|
|
- columnName.add("houseOrderNumber");
|
|
|
|
|
- columnName.add("payAccount");
|
|
|
|
|
- columnName.add("payTime");
|
|
|
|
|
|
|
+ columnName.add("订单号");
|
|
|
|
|
+ columnName.add("预定人");
|
|
|
|
|
+ columnName.add("手机号");
|
|
|
|
|
+ columnName.add("房间数");
|
|
|
|
|
+ columnName.add("订单金额");
|
|
|
|
|
+ columnName.add("退房时间");
|
|
|
// 导出文件
|
|
// 导出文件
|
|
|
- new toExcel().book(list, path + "台账信息" + "Report.xls",
|
|
|
|
|
|
|
+ new toExcel().book(vectorsList, path + "台账信息" + UUIDUtil.generateID() + "Report.xls",
|
|
|
"sheet1", columnName);
|
|
"sheet1", columnName);
|
|
|
String url = request.getSession().getServletContext().getContextPath();
|
|
String url = request.getSession().getServletContext().getContextPath();
|
|
|
resultJson.put("downurl", url+"/download/台账信息" + "Report.xls");
|
|
resultJson.put("downurl", url+"/download/台账信息" + "Report.xls");
|