|
@@ -15,6 +15,7 @@ import com.happy.Until.weixin.JaxbUtil;
|
|
|
import com.happy.Until.weixin.PayWxUtil;
|
|
import com.happy.Until.weixin.PayWxUtil;
|
|
|
import com.happy.Until.weixin.TongYiReturn;
|
|
import com.happy.Until.weixin.TongYiReturn;
|
|
|
import com.happy.common.http.Message;
|
|
import com.happy.common.http.Message;
|
|
|
|
|
+import com.happy.common.http.Message2;
|
|
|
import com.happy.common.wx.WxUtil;
|
|
import com.happy.common.wx.WxUtil;
|
|
|
import com.happy.constant.ResultStatusCode;
|
|
import com.happy.constant.ResultStatusCode;
|
|
|
import com.happy.service.AdminManagerService;
|
|
import com.happy.service.AdminManagerService;
|
|
@@ -146,14 +147,15 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
if (booking == null || Func.checkNull(booking.getCreateTime()) || Func.checkNull(booking.getLockTime()))
|
|
if (booking == null || Func.checkNull(booking.getCreateTime()) || Func.checkNull(booking.getLockTime()))
|
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
|
|
+ Date createTime = DateUtil.parseDate(booking.getCreateTime(),DateUtil.Time_Formatter_Second);
|
|
|
// 对订单时间进行累加
|
|
// 对订单时间进行累加
|
|
|
- String lockTime = TimeExchange.TimeRangeM(booking.getCreateTime(),Func.parseInt(booking.getLockTime()));
|
|
|
|
|
|
|
+ String lockTime = TimeExchange.TimeRangeM(DateUtil.getFormatPaternDate(createTime),Func.parseInt(booking.getLockTime()));
|
|
|
// 当前时间 大于 锁定时间 为true
|
|
// 当前时间 大于 锁定时间 为true
|
|
|
boolean flag = TimeExchange.CompareDate(lockTime, TimeExchange.getDate());
|
|
boolean flag = TimeExchange.CompareDate(lockTime, TimeExchange.getDate());
|
|
|
if (flag)
|
|
if (flag)
|
|
|
{
|
|
{
|
|
|
// 如果超时,则将订单状态修改为已超时
|
|
// 如果超时,则将订单状态修改为已超时
|
|
|
- booking.setOrderStatus(Func.parseStr(PayEnum.SIX.getPayStatus()));
|
|
|
|
|
|
|
+ booking.setOrderStatus(Func.parseStr(PayEnum.SIX.getNum()));
|
|
|
booking.setUpdateTime(TimeExchange.getDate());
|
|
booking.setUpdateTime(TimeExchange.getDate());
|
|
|
bookService.updateBooking(booking);
|
|
bookService.updateBooking(booking);
|
|
|
System.out.println("已将订单"+booking.getOrderNum()+"标识为支付超时");
|
|
System.out.println("已将订单"+booking.getOrderNum()+"标识为支付超时");
|
|
@@ -629,7 +631,7 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
params.put("nonce_str", w.getNonce_str());
|
|
params.put("nonce_str", w.getNonce_str());
|
|
|
params.put("body", w.getBody());
|
|
params.put("body", w.getBody());
|
|
|
params.put("out_trade_no", w.getOut_trade_no());
|
|
params.put("out_trade_no", w.getOut_trade_no());
|
|
|
- params.put("total_fee", w.getTotal_fee() + "");
|
|
|
|
|
|
|
+ params.put("total_fee", Func.parseStr(w.getTotal_fee()));
|
|
|
params.put("spbill_create_ip", w.getSpbill_create_ip());
|
|
params.put("spbill_create_ip", w.getSpbill_create_ip());
|
|
|
params.put("notify_url", w.getNotify_url());
|
|
params.put("notify_url", w.getNotify_url());
|
|
|
params.put("trade_type", w.getTrade_type());
|
|
params.put("trade_type", w.getTrade_type());
|
|
@@ -672,7 +674,7 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
|
|
|
|
|
// 保存支付信息
|
|
// 保存支付信息
|
|
|
booking.setUpdateTime(DateUtil.getFormatPaternDate(new Date()));
|
|
booking.setUpdateTime(DateUtil.getFormatPaternDate(new Date()));
|
|
|
- booking.setOrderStatus(Func.parseStr(PayEnum.TWO.getNum()));
|
|
|
|
|
|
|
+ booking.setOrderStatus(Func.parseStr(PayEnum.ONE.getNum()));
|
|
|
booking.setPayTime(DateUtil.getFormatPaternDate(new Date()));
|
|
booking.setPayTime(DateUtil.getFormatPaternDate(new Date()));
|
|
|
booking.setPayAccount(totalPrice);
|
|
booking.setPayAccount(totalPrice);
|
|
|
booking.setPayWay(OrderEnum.微信支付.toString());
|
|
booking.setPayWay(OrderEnum.微信支付.toString());
|
|
@@ -723,9 +725,19 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
// 进行业务判断,如果是商家设定了自动接单,则支付状态直接变为待入住 接单设置(1自动接单 2手动接单)
|
|
// 进行业务判断,如果是商家设定了自动接单,则支付状态直接变为待入住 接单设置(1自动接单 2手动接单)
|
|
|
if ("1".equals(booking.getHotelIsCanorder()))
|
|
if ("1".equals(booking.getHotelIsCanorder()))
|
|
|
{
|
|
{
|
|
|
|
|
+ // 自动接单,发消息给用户,并且订单状态修改为待入住
|
|
|
booking.setOrderStatus(Func.parseStr(PayEnum.THREE.getNum()));
|
|
booking.setOrderStatus(Func.parseStr(PayEnum.THREE.getNum()));
|
|
|
|
|
+ String userId = booking.getCreateUserid();
|
|
|
|
|
+ Users users = userService.queryByUserId(userId);
|
|
|
|
|
+ String mess = "您已成功订房,订单号:"+order_num;
|
|
|
|
|
+ Message.send(users.getOpenid(),order_num, users.getUser_name(),mess, booking.getPayTime());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ // 手动接单,发消息给商家
|
|
|
|
|
+ AdminManager adminManager = adminManagerService.getById(Func.parseInt(booking.getHotelManagerId()));
|
|
|
|
|
+ String sendMsg = "订单:"+ order_num +"已支付,请确认是否接单";
|
|
|
|
|
+ String live_end = DateUtil.parseDate(booking.getOrderStartTime(),DateUtil.Time_Formatter_Day) +"至"+ DateUtil.parseDate(booking.getOrderEndTime(),DateUtil.Time_Formatter_Day);
|
|
|
|
|
+ Message2.send(adminManager.getOpenid(),order_num,booking.getHouseName(),live_end,booking.getUserName(),booking.getHotelName());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
int m = bookService.updateBooking(booking);
|
|
int m = bookService.updateBooking(booking);
|
|
|
if (m>0){
|
|
if (m>0){
|
|
|
String returnMsg = "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
|
|
String returnMsg = "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
|
|
@@ -736,14 +748,8 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
out.flush();
|
|
out.flush();
|
|
|
out.close(); // 发送成功消息给商家
|
|
out.close(); // 发送成功消息给商家
|
|
|
}
|
|
}
|
|
|
|
|
+ return null;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- AdminManager adminManager = adminManagerService.getById(Func.parseInt(booking.getHotelManagerId()));
|
|
|
|
|
- String sendMsg = "订单:"+ order_num +"已支付,请确认是否接单";
|
|
|
|
|
- // 推送消息给商家 TODO
|
|
|
|
|
- Message.send(adminManager.getOpenid(),booking.getOrderNum(),booking.getUserName(),sendMsg,booking.getCreateTime());
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
} catch (Exception e){
|
|
} catch (Exception e){
|
|
|
resultjson.put("message", "支付失败");
|
|
resultjson.put("message", "支付失败");
|
|
|
resultjson.put("code", 205);
|
|
resultjson.put("code", 205);
|