|
@@ -143,8 +143,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
if (Func.checkNull(houseId) || Func.checkNull(startTime) || Func.checkNull(endTime)
|
|
if (Func.checkNull(houseId) || Func.checkNull(startTime) || Func.checkNull(endTime)
|
|
|
|| Func.checkNull(houseOrderNumber) || Func.checkNull(userName) || Func.checkNull(userPhone) || Func.checkNull(userId)) {
|
|
|| Func.checkNull(houseOrderNumber) || Func.checkNull(userName) || Func.checkNull(userPhone) || Func.checkNull(userId)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -156,22 +156,22 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
// 创建订单之前,先验证是否有房间
|
|
// 创建订单之前,先验证是否有房间
|
|
|
String backMessage = appBookService.varificationHouse(houseId, startDate, endDate);
|
|
String backMessage = appBookService.varificationHouse(houseId, startDate, endDate);
|
|
|
if (Func.checkNull(backMessage)) {
|
|
if (Func.checkNull(backMessage)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.CANNTBOOKING.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, backMessage);
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.CANNTBOOKING.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, backMessage);
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String mess = appBookService.createOrder(houseId, startDate, endDate, houseOrderNumber, userName, userPhone, userId);
|
|
String mess = appBookService.createOrder(houseId, startDate, endDate, houseOrderNumber, userName, userPhone, userId);
|
|
|
if (!Func.checkNull(mess)) {
|
|
if (!Func.checkNull(mess)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, mess);
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, mess);
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.OK.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.OK.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -186,8 +186,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
if (Func.checkNull(houseId) || Func.checkNull(startTime) || Func.checkNull(endTime)
|
|
if (Func.checkNull(houseId) || Func.checkNull(startTime) || Func.checkNull(endTime)
|
|
|
|| Func.checkNull(houseOrderNumber) || Func.checkNull(userName) || Func.checkNull(userPhone) || Func.checkNull(userId)) {
|
|
|| Func.checkNull(houseOrderNumber) || Func.checkNull(userName) || Func.checkNull(userPhone) || Func.checkNull(userId)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -199,16 +199,16 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
// 创建订单之前,先验证是否有房间
|
|
// 创建订单之前,先验证是否有房间
|
|
|
String backMessage = appBookService.varificationHouse(houseId, startDate, endDate);
|
|
String backMessage = appBookService.varificationHouse(houseId, startDate, endDate);
|
|
|
if (Func.checkNull(backMessage)) {
|
|
if (Func.checkNull(backMessage)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.CANNTBOOKING.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, backMessage);
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.CANNTBOOKING.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, backMessage);
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
appBookService.reCreateOrder(houseId, startTime, endTime, houseOrderNumber, userName, userPhone, userId);
|
|
appBookService.reCreateOrder(houseId, startTime, endTime, houseOrderNumber, userName, userPhone, userId);
|
|
|
|
|
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.OK.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.OK.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -230,8 +230,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
// 取消订单,修改订单的支付状态
|
|
// 取消订单,修改订单的支付状态
|
|
|
String mess = bookService.cancelBooking(getBookingId());
|
|
String mess = bookService.cancelBooking(getBookingId());
|
|
|
if (!Func.checkNull(mess)) {
|
|
if (!Func.checkNull(mess)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, mess);
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, mess);
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -243,16 +243,16 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
// 进行判断如果订单是已取消,并且标识字段微信退款,则进入退款流程
|
|
// 进行判断如果订单是已取消,并且标识字段微信退款,则进入退款流程
|
|
|
if (Func.parseStr(PayEnum.SEVEN.getNum()).equals(booking.getOrderStatus()) && OrderEnum.微信退款.toString().equals(booking.getRefundWay())) {
|
|
if (Func.parseStr(PayEnum.SEVEN.getNum()).equals(booking.getOrderStatus()) && OrderEnum.微信退款.toString().equals(booking.getRefundWay())) {
|
|
|
if (Func.checkNull(this.open_id) || Func.checkNull(this.bookingId)) {
|
|
if (Func.checkNull(this.open_id) || Func.checkNull(this.bookingId)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Users users = userService.queryByOpenid(open_id); // 用户信息
|
|
Users users = userService.queryByOpenid(open_id); // 用户信息
|
|
|
if (users == null || booking == null) {
|
|
if (users == null || booking == null) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -319,8 +319,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.OK.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.OK.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -333,8 +333,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
public String refundBooking() throws Exception {
|
|
public String refundBooking() throws Exception {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
if (Func.checkNull(this.open_id) || Func.checkNull(this.bookingId)) {
|
|
if (Func.checkNull(this.open_id) || Func.checkNull(this.bookingId)) {
|
|
|
- resultJson.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- resultJson.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ resultJson.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ resultJson.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -342,8 +342,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
Users users = userService.queryByOpenid(open_id); // 用户信息
|
|
Users users = userService.queryByOpenid(open_id); // 用户信息
|
|
|
Booking booking = bookService.getById(Func.parseInt(bookingId)); // 订单信息
|
|
Booking booking = bookService.getById(Func.parseInt(bookingId)); // 订单信息
|
|
|
if (users == null || booking == null) {
|
|
if (users == null || booking == null) {
|
|
|
- resultJson.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- resultJson.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ resultJson.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ resultJson.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -490,14 +490,14 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
|
|
|
|
|
String mess = bookService.delBooking(getBookingId());
|
|
String mess = bookService.delBooking(getBookingId());
|
|
|
if (!Func.checkNull(mess)) {
|
|
if (!Func.checkNull(mess)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, mess);
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, mess);
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.OK.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.OK.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -514,8 +514,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
public String varificationHouse() {
|
|
public String varificationHouse() {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
if (Func.checkNull(houseId) || Func.checkNull(startTime) || Func.checkNull(endTime)) {
|
|
if (Func.checkNull(houseId) || Func.checkNull(startTime) || Func.checkNull(endTime)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -523,14 +523,14 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
String backMessage = appBookService.varificationHouse(houseId, startTime, endTime);
|
|
String backMessage = appBookService.varificationHouse(houseId, startTime, endTime);
|
|
|
|
|
|
|
|
if (!Func.checkNull(backMessage)) {
|
|
if (!Func.checkNull(backMessage)) {
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, backMessage);
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, backMessage);
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- jsonObject.put(B.CODE, ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.MESSAGE, OrderEnum.有空房.toString());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.message, OrderEnum.有空房.toString());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -546,8 +546,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
public String pay() {
|
|
public String pay() {
|
|
|
JSONObject resultjson = new JSONObject();
|
|
JSONObject resultjson = new JSONObject();
|
|
|
if (Func.checkNull(this.open_id) || Func.checkNull(this.bookingId)) {
|
|
if (Func.checkNull(this.open_id) || Func.checkNull(this.bookingId)) {
|
|
|
- resultjson.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- resultjson.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ resultjson.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ resultjson.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -555,8 +555,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
Users users = userService.queryByOpenid(open_id); // 用户信息
|
|
Users users = userService.queryByOpenid(open_id); // 用户信息
|
|
|
Booking booking = bookService.getById(Func.parseInt(bookingId)); // 订单信息
|
|
Booking booking = bookService.getById(Func.parseInt(bookingId)); // 订单信息
|
|
|
if (users == null || booking == null) {
|
|
if (users == null || booking == null) {
|
|
|
- resultjson.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- resultjson.put(B.MESSAGE, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
|
|
+ resultjson.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ resultjson.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -633,13 +633,13 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
booking.setPayWay(OrderEnum.微信支付.toString());
|
|
booking.setPayWay(OrderEnum.微信支付.toString());
|
|
|
bookService.updateBooking(booking);
|
|
bookService.updateBooking(booking);
|
|
|
|
|
|
|
|
- resultjson.put(B.CODE, ResultStatusCode.OK.getStatus());
|
|
|
|
|
- resultjson.put(B.MESSAGE, "支付成功");
|
|
|
|
|
|
|
+ resultjson.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ resultjson.put(B.message, "支付成功");
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- resultjson.put(B.CODE, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
- resultjson.put(B.MESSAGE, e.getMessage());
|
|
|
|
|
|
|
+ resultjson.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
|
|
+ resultjson.put(B.message, e.getMessage());
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|