|
|
@@ -3,18 +3,17 @@ package com.happy.action;
|
|
|
import com.baidubce.model.User;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.happy.Model.Booking;
|
|
|
+import com.happy.Model.FileInfo;
|
|
|
import com.happy.Model.weixin.*;
|
|
|
import com.happy.Until.*;
|
|
|
import com.happy.Until.Enum.B;
|
|
|
import com.happy.Until.Enum.DataType;
|
|
|
import com.happy.common.http.HttpsClient;
|
|
|
import com.happy.common.wx.WxUtil;
|
|
|
+import com.happy.constant.ConstDefault;
|
|
|
import com.happy.constant.ResultStatusCode;
|
|
|
import com.happy.dto.IPage;
|
|
|
-import com.happy.service.AppService;
|
|
|
-import com.happy.service.BookService;
|
|
|
-import com.happy.service.HotelService;
|
|
|
-import com.happy.service.UserService;
|
|
|
+import com.happy.service.*;
|
|
|
import com.opensymphony.xwork2.ActionSupport;
|
|
|
import net.sf.json.JSONObject;
|
|
|
import org.apache.struts2.ServletActionContext;
|
|
|
@@ -42,6 +41,8 @@ public class AppMePageAction extends ActionSupport implements ServletRequestAwar
|
|
|
public AppService appService;
|
|
|
@Resource
|
|
|
public HotelService hotelService;
|
|
|
+ @Resource
|
|
|
+ public FileService fileService;
|
|
|
|
|
|
private String contactUserName; // 常用联系人姓名
|
|
|
private String contactUserIdNum; // 常用联系人身份证
|
|
|
@@ -123,7 +124,19 @@ public class AppMePageAction extends ActionSupport implements ServletRequestAwar
|
|
|
if (!Func.checkNull(userId)){
|
|
|
querySql.append(" and create_userid = '").append(userId).append("' ");
|
|
|
}
|
|
|
- ResponseUtil.writeJsonIPage(ServletActionContext.getResponse(),bookService.queryPage(querySql.toString(), page, rows));
|
|
|
+
|
|
|
+ IPage<Booking> iPage = bookService.queryPage(querySql.toString(), page, rows);
|
|
|
+ List<Booking> bookList =iPage.getPageList();
|
|
|
+ for (Booking book: bookList) {
|
|
|
+ if (book == null || Func.checkNull(book.getHouseId()))
|
|
|
+ continue;
|
|
|
+
|
|
|
+ // 将房间图片,写入房型对象中
|
|
|
+ List<FileInfo> fileInfoList = fileService.queryListByLinkId(book.getHouseId());
|
|
|
+ book.setHouseFileInfoList(fileInfoList);
|
|
|
+ }
|
|
|
+
|
|
|
+ ResponseUtil.writeJsonIPage(ServletActionContext.getResponse(),iPage);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@@ -174,6 +187,10 @@ public class AppMePageAction extends ActionSupport implements ServletRequestAwar
|
|
|
book.setHouseConfigList(houseDicList);
|
|
|
}
|
|
|
|
|
|
+ // 将房间图片,写入房型对象中
|
|
|
+ List<FileInfo> fileInfoList = fileService.queryListByLinkId(book.getHouseId());
|
|
|
+ book.setHouseFileInfoList(fileInfoList);
|
|
|
+
|
|
|
resultJson.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
resultJson.put(B.message,ResultStatusCode.OK.getMsg());
|
|
|
resultJson.put(B.data,book);
|
|
|
@@ -418,7 +435,7 @@ public class AppMePageAction extends ActionSupport implements ServletRequestAwar
|
|
|
// 确定默认用户名,默认用户头像
|
|
|
String userName = Func.parseStr(WxUtil.createDefaultUserName());
|
|
|
users.setUser_name(userName);
|
|
|
- users.setHeadPhoto("https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/head.png");
|
|
|
+ users.setHeadPhoto(ConstDefault.DefaultHeadPhoto);
|
|
|
users.setOpenid(OPEN_ID);
|
|
|
users.setCreate_time(DateUtil.getFormatPaternDate(new Date()));
|
|
|
users.setDataType(DataType.游客数据.toString());
|