|
|
@@ -243,30 +243,30 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- if (booking.getStatus().equals("1")){
|
|
|
- resultJson.put("message", "订单未支付不能进行其他操作");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (booking.getStatus().equals("3")){
|
|
|
- resultJson.put("message", "该订单已入住请勿重复办理");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (booking.getStatus().equals("4") || booking.getStatus().equals("5") || booking.getStatus().equals("6")){
|
|
|
- resultJson.put("message", "该订单已完成不能进行其他操作");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (!booking.getLive_time().equals(TimeExchange.getDate())){
|
|
|
- resultJson.put("message", "该订单未到入住时间或已过期,请重新下单");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
+// if (booking.getStatus().equals("1")){
|
|
|
+// resultJson.put("message", "订单未支付不能进行其他操作");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if (booking.getStatus().equals("3")){
|
|
|
+// resultJson.put("message", "该订单已入住请勿重复办理");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if (booking.getStatus().equals("4") || booking.getStatus().equals("5") || booking.getStatus().equals("6")){
|
|
|
+// resultJson.put("message", "该订单已完成不能进行其他操作");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if (!booking.getLive_time().equals(TimeExchange.getDate())){
|
|
|
+// resultJson.put("message", "该订单未到入住时间或已过期,请重新下单");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
int m = bookService.update(status,dom,id);
|
|
|
if(m>0){
|
|
|
resultJson.put("message", "操作成功");
|
|
|
@@ -302,71 +302,71 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- if (booking.getStatus().equals("1")){
|
|
|
- resultJson.put("message", "订单未支付不能进行其他操作");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (booking.getStatus().equals("3")){
|
|
|
- resultJson.put("message", "该订单已入住,请办理退房");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (booking.getStatus().equals("4") || booking.getStatus().equals("5") || booking.getStatus().equals("6")){
|
|
|
- resultJson.put("message", "该订单已完成不能进行其他操作");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
+// if (booking.getStatus().equals("1")){
|
|
|
+// resultJson.put("message", "订单未支付不能进行其他操作");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if (booking.getStatus().equals("3")){
|
|
|
+// resultJson.put("message", "该订单已入住,请办理退房");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if (booking.getStatus().equals("4") || booking.getStatus().equals("5") || booking.getStatus().equals("6")){
|
|
|
+// resultJson.put("message", "该订单已完成不能进行其他操作");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
//String ip = request.getParameter("ip");
|
|
|
String ip = "171.34.223.11";
|
|
|
- double money = booking.getPay_account();
|
|
|
- int a = (int) (money * 100);
|
|
|
- WechatUnifiedOrder w = new WechatUnifiedOrder();
|
|
|
- w.setAppid(WeiXinUtil.appid_c);
|
|
|
- w.setAttach("chengxin");
|
|
|
- w.setBody("chengxin");
|
|
|
- w.setMch_id(WeiXinUtil.account);
|
|
|
- w.setNonce_str(PayWxUtil.getNonceStr());// 随机支付串
|
|
|
- w.setNotify_url(WeiXinUtil.ip_h + "/bookrefundResulet.action");// 支付结果回调地址
|
|
|
- w.setOpenid("");
|
|
|
- w.setOut_trade_no(booking.getOrder_num());
|
|
|
- String refund_order = WxUtil.mchOrderNo();
|
|
|
- w.setOut_refund_no(refund_order); // 退款单号
|
|
|
- w.setSpbill_create_ip(ip);
|
|
|
- w.setTotal_fee(a);
|
|
|
- w.setRefund_fee(a); // 退款金额
|
|
|
- w.setTrade_type("JSAPI");
|
|
|
- Map<String, String> params = new HashMap<String, String>();
|
|
|
- params.put("attach", w.getAttach());
|
|
|
- params.put("appid", w.getAppid());
|
|
|
- params.put("mch_id", w.getMch_id());
|
|
|
- params.put("nonce_str", w.getNonce_str());
|
|
|
- params.put("body", w.getBody());
|
|
|
- params.put("out_trade_no", w.getOut_trade_no());
|
|
|
- params.put("out_refund_no", w.getOut_refund_no()); // 退款单号
|
|
|
- params.put("total_fee", w.getTotal_fee() + "");
|
|
|
- params.put("refund_fee",w.getRefund_fee()+""); // 退款金额
|
|
|
- params.put("spbill_create_ip", w.getSpbill_create_ip());
|
|
|
- params.put("notify_url", w.getNotify_url());
|
|
|
- params.put("trade_type", w.getTrade_type());
|
|
|
- params.put("openid", w.getOpenid());
|
|
|
- w.setSign(PayWxUtil.getSign(params, WeiXinUtil.APIid));
|
|
|
- params.put("sign", w.getSign());
|
|
|
- String retXml = JaxbUtil.getRequestXml(params);
|
|
|
- String msg = HttpUtils.post("https://api.mch.weixin.qq.com/secapi/pay/refund", retXml);
|
|
|
- System.out.println(msg);
|
|
|
- if (msg.indexOf("FAIL") > -1) {
|
|
|
- resultJson.put("code", 507);
|
|
|
- resultJson.put("message", "退款失败");
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
- resultJson.put("code", 200);
|
|
|
- resultJson.put("message", "退款申请已提交,请稍候查询");
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// double money = booking.getPay_account();
|
|
|
+// int a = (int) (money * 100);
|
|
|
+// WechatUnifiedOrder w = new WechatUnifiedOrder();
|
|
|
+// w.setAppid(WeiXinUtil.appid_c);
|
|
|
+// w.setAttach("chengxin");
|
|
|
+// w.setBody("chengxin");
|
|
|
+// w.setMch_id(WeiXinUtil.account);
|
|
|
+// w.setNonce_str(PayWxUtil.getNonceStr());// 随机支付串
|
|
|
+// w.setNotify_url(WeiXinUtil.ip_h + "/bookrefundResulet.action");// 支付结果回调地址
|
|
|
+// w.setOpenid("");
|
|
|
+// w.setOut_trade_no(booking.getOrder_num());
|
|
|
+// String refund_order = WxUtil.mchOrderNo();
|
|
|
+// w.setOut_refund_no(refund_order); // 退款单号
|
|
|
+// w.setSpbill_create_ip(ip);
|
|
|
+// w.setTotal_fee(a);
|
|
|
+// w.setRefund_fee(a); // 退款金额
|
|
|
+// w.setTrade_type("JSAPI");
|
|
|
+// Map<String, String> params = new HashMap<String, String>();
|
|
|
+// params.put("attach", w.getAttach());
|
|
|
+// params.put("appid", w.getAppid());
|
|
|
+// params.put("mch_id", w.getMch_id());
|
|
|
+// params.put("nonce_str", w.getNonce_str());
|
|
|
+// params.put("body", w.getBody());
|
|
|
+// params.put("out_trade_no", w.getOut_trade_no());
|
|
|
+// params.put("out_refund_no", w.getOut_refund_no()); // 退款单号
|
|
|
+// params.put("total_fee", w.getTotal_fee() + "");
|
|
|
+// params.put("refund_fee",w.getRefund_fee()+""); // 退款金额
|
|
|
+// params.put("spbill_create_ip", w.getSpbill_create_ip());
|
|
|
+// params.put("notify_url", w.getNotify_url());
|
|
|
+// params.put("trade_type", w.getTrade_type());
|
|
|
+// params.put("openid", w.getOpenid());
|
|
|
+// w.setSign(PayWxUtil.getSign(params, WeiXinUtil.APIid));
|
|
|
+// params.put("sign", w.getSign());
|
|
|
+// String retXml = JaxbUtil.getRequestXml(params);
|
|
|
+// String msg = HttpUtils.post("https://api.mch.weixin.qq.com/secapi/pay/refund", retXml);
|
|
|
+// System.out.println(msg);
|
|
|
+// if (msg.indexOf("FAIL") > -1) {
|
|
|
+// resultJson.put("code", 507);
|
|
|
+// resultJson.put("message", "退款失败");
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// resultJson.put("code", 200);
|
|
|
+// resultJson.put("message", "退款申请已提交,请稍候查询");
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@@ -421,24 +421,24 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- if (booking.getStatus().equals("1")){
|
|
|
- resultJson.put("message", "订单未支付不能进行其他操作");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (booking.getStatus().equals("2")){
|
|
|
- resultJson.put("message", "该订单未入住,请办理退款");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (booking.getStatus().equals("4") || booking.getStatus().equals("5") || booking.getStatus().equals("6")){
|
|
|
- resultJson.put("message", "该订单已完成不能进行其他操作");
|
|
|
- resultJson.put("code", 500);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- return null;
|
|
|
- }
|
|
|
+// if (booking.getStatus().equals("1")){
|
|
|
+// resultJson.put("message", "订单未支付不能进行其他操作");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if (booking.getStatus().equals("2")){
|
|
|
+// resultJson.put("message", "该订单未入住,请办理退款");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if (booking.getStatus().equals("4") || booking.getStatus().equals("5") || booking.getStatus().equals("6")){
|
|
|
+// resultJson.put("message", "该订单已完成不能进行其他操作");
|
|
|
+// resultJson.put("code", 500);
|
|
|
+// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+// return null;
|
|
|
+// }
|
|
|
int m = bookService.update(status,dom,id);
|
|
|
if(m>0){
|
|
|
resultJson.put("message", "操作成功");
|