|
|
@@ -1,9 +1,13 @@
|
|
|
package com.happy.action;
|
|
|
|
|
|
+import com.happy.Model.Booking;
|
|
|
+import com.happy.Model.weixin.Users;
|
|
|
import com.happy.Until.Enum.B;
|
|
|
import com.happy.Until.Func;
|
|
|
+import com.happy.Until.ResUtil;
|
|
|
import com.happy.Until.ResponseUtil;
|
|
|
import com.happy.Until.ResultUtil;
|
|
|
+import com.happy.common.http.Message;
|
|
|
import com.happy.constant.ResultStatusCode;
|
|
|
import com.happy.service.AppBookService;
|
|
|
import com.happy.service.BookService;
|
|
|
@@ -43,6 +47,16 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
public String userPhone; // 住客联系电话
|
|
|
public String userId; // 下单人id
|
|
|
|
|
|
+ public String getBookingId() {
|
|
|
+ return bookingId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setBookingId(String bookingId) {
|
|
|
+ this.bookingId = bookingId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String bookingId; // 订单Id
|
|
|
+
|
|
|
public HttpServletRequest getRequest() {
|
|
|
return request;
|
|
|
}
|
|
|
@@ -150,6 +164,55 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 取消订单功能
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String cancelBooking(){
|
|
|
+ if (Func.checkNull(bookingId))
|
|
|
+ return null;
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+
|
|
|
+ String mess = bookService.cancelBooking(bookingId);
|
|
|
+ if (!Func.checkNull(mess))
|
|
|
+ {
|
|
|
+ jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
+ jsonObject.put(B.MESSAGE,mess);
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ jsonObject.put(B.CODE, ResultStatusCode.OK.getStatus());
|
|
|
+ jsonObject.put(B.MESSAGE,ResultStatusCode.OK.getMsg());
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除订单功能(假删除)
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String delBooking(){
|
|
|
+ if (Func.checkNull(bookingId))
|
|
|
+ return null;
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+
|
|
|
+ String mess = bookService.delBooking(bookingId);
|
|
|
+ if (!Func.checkNull(mess))
|
|
|
+ {
|
|
|
+ jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
+ jsonObject.put(B.MESSAGE,mess);
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ jsonObject.put(B.CODE, ResultStatusCode.OK.getStatus());
|
|
|
+ jsonObject.put(B.MESSAGE,ResultStatusCode.OK.getMsg());
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|