|
|
@@ -1,6 +1,7 @@
|
|
|
package com.happy.action;
|
|
|
|
|
|
import com.baidubce.model.User;
|
|
|
+import com.happy.Model.AdminManager;
|
|
|
import com.happy.Model.Booking;
|
|
|
import com.happy.Model.HotelDict;
|
|
|
import com.happy.Model.weixin.Users;
|
|
|
@@ -9,6 +10,7 @@ import com.happy.Until.Excel.toExcel;
|
|
|
import com.happy.common.http.Message;
|
|
|
import com.happy.dto.BookTypeEto;
|
|
|
import com.happy.dto.IPage;
|
|
|
+import com.happy.service.AdminManagerService;
|
|
|
import com.happy.service.BookService;
|
|
|
import com.happy.service.HotelDictService;
|
|
|
import com.happy.service.UserService;
|
|
|
@@ -37,6 +39,8 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
public UserService userService;
|
|
|
@Resource
|
|
|
public HotelDictService hotelDictService;
|
|
|
+ @Resource
|
|
|
+ public AdminManagerService adminManagerService;
|
|
|
|
|
|
public int page; // 当前页
|
|
|
public int rows;// 每页显示的行数rows
|
|
|
@@ -236,6 +240,12 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|
|
|
s1.append(" and hotel_manager_id = '").append(managerId).append("'");
|
|
|
+ if(managerId==null){
|
|
|
+ resultJson.put("code", 500);
|
|
|
+ resultJson.put("message", "managerId禁止为空");
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
+ resultJson.toString());
|
|
|
+ }
|
|
|
if (ledgerParam!=null){
|
|
|
s1.append(" and (order_num like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_name like '%").append(ledgerParam).append("%'")
|
|
|
@@ -261,11 +271,11 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
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.getUserName());//用户名称
|
|
|
+ columnValue.add(book.getUserPhone());//用户电话
|
|
|
+ columnValue.add(book.getHouseName());//房型名称
|
|
|
+ columnValue.add(book.getHouseOrderNumber());//订房数量
|
|
|
+ columnValue.add(book.getHouseTotalPrice());//总价
|
|
|
columnValue.add(book.getPayTime());
|
|
|
vectorsList.add(columnValue);
|
|
|
}
|
|
|
@@ -401,6 +411,12 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
|
|
|
List<Booking> list = bookService.queryList(s1.toString()); // 查询列表
|
|
|
+ if(list==null){
|
|
|
+ resultJson.put("code", 500);
|
|
|
+ resultJson.put("message", "无数据无法导出");
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
+ resultJson.toString());
|
|
|
+ }
|
|
|
List<Vector> vectorsList = new ArrayList<>();
|
|
|
for(Booking book:list){
|
|
|
Vector columnValue = new Vector();
|
|
|
@@ -483,8 +499,14 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
List<Vector> vectorsList = new ArrayList<>();
|
|
|
for(Booking book:list){
|
|
|
Vector columnValue = new Vector();
|
|
|
- columnValue.add(dictMap.get(Integer.valueOf(book.getHotelTownship())));//所属乡镇
|
|
|
- columnValue.add(book.getHotelName());//乡宿名称
|
|
|
+ AdminManager adminManager = adminManagerService.getById(book.getHotelManagerId());
|
|
|
+ if(adminManager!=null){
|
|
|
+ columnValue.add(dictMap.get(Integer.valueOf(adminManager.getHotelTownship())));//所属乡镇
|
|
|
+ columnValue.add(adminManager.getHotelName());//乡宿名称
|
|
|
+ }else{
|
|
|
+ columnValue.add("");//所属乡镇
|
|
|
+ columnValue.add("");//乡宿名称
|
|
|
+ }
|
|
|
columnValue.add(book.getOrderNum());//订单号
|
|
|
columnValue.add(book.getPayAccount());//订单金额
|
|
|
columnValue.add(book.getPayTime());//退房时间
|