|
|
@@ -7,63 +7,52 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.fasterxml.jackson.annotation.JsonInclude;
|
|
|
-import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
-import com.fasterxml.jackson.databind.JsonNode;
|
|
|
-import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.template.annotation.PassToken;
|
|
|
import com.template.api.HouseOrderAPI;
|
|
|
import com.template.common.utils.*;
|
|
|
-import com.template.common.utils.weixin.UnifiedOrderVO;
|
|
|
import com.template.component.WeiXiaoComponent;
|
|
|
import com.template.config.WeixiaoConfig;
|
|
|
import com.template.config.WxPayV3Config;
|
|
|
import com.template.model.dto.*;
|
|
|
import com.template.model.enumModel.ePayStatu;
|
|
|
-import com.template.model.vo.*;
|
|
|
import com.template.model.pojo.*;
|
|
|
import com.template.model.result.CommonResult;
|
|
|
import com.template.model.result.PageUtils;
|
|
|
-import com.template.model.weixin.*;
|
|
|
+import com.template.model.vo.*;
|
|
|
+import com.template.model.weixin.DateTimeZoneUtil;
|
|
|
+import com.template.model.weixin.PayUtil;
|
|
|
+import com.template.model.weixin.SecurityUtil;
|
|
|
+import com.template.model.weixin.WechatPayV3Util;
|
|
|
import com.template.services.*;
|
|
|
import com.wechat.pay.java.core.Config;
|
|
|
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
|
|
-import com.wechat.pay.java.core.RSAConfig;
|
|
|
-import com.wechat.pay.java.core.exception.ValidationException;
|
|
|
import com.wechat.pay.java.core.notification.NotificationConfig;
|
|
|
import com.wechat.pay.java.core.notification.NotificationParser;
|
|
|
+import com.wechat.pay.java.core.notification.RequestParam;
|
|
|
import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
|
|
|
import com.wechat.pay.java.service.payments.jsapi.model.*;
|
|
|
-import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
|
|
import com.wechat.pay.java.service.payments.model.Transaction;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.http.HttpResponse;
|
|
|
-import org.apache.http.client.HttpClient;
|
|
|
-import org.apache.http.client.methods.HttpPost;
|
|
|
-import org.apache.http.entity.StringEntity;
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
-import org.apache.http.impl.client.HttpClientBuilder;
|
|
|
-import org.apache.http.util.EntityUtils;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.*;
|
|
|
+import org.springframework.http.HttpEntity;
|
|
|
+import org.springframework.http.HttpHeaders;
|
|
|
+import org.springframework.http.HttpMethod;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
-import javax.annotation.PostConstruct;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
-import java.security.*;
|
|
|
+import java.security.Signature;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneId;
|
|
|
@@ -1726,8 +1715,15 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
.config(config)
|
|
|
.signType("RSA") // 不填默认为RSA
|
|
|
.build();
|
|
|
- PrepayWithRequestPaymentResponse responseSdk=service.prepayWithRequestPayment(requestpay);
|
|
|
- log.info("请求支付参数返回:"+responseSdk.toString());
|
|
|
+
|
|
|
+ PrepayWithRequestPaymentResponse responseSdk= null;
|
|
|
+ try {
|
|
|
+ responseSdk = service.prepayWithRequestPayment(requestpay);
|
|
|
+ log.info("请求支付参数返回:"+responseSdk.toString());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("请求支付异常返回:"+e);
|
|
|
+ return CommonResult.ok(e.getMessage());
|
|
|
+ }
|
|
|
return CommonResult.ok(responseSdk);
|
|
|
}
|
|
|
|
|
|
@@ -1809,177 +1805,177 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
public void returnPay(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
System.out.println(TimeExchange.getTime() + "进入支付回调====");
|
|
|
// 构造 RequestParam
|
|
|
-// String result = PayUtil.readData(request);
|
|
|
-// RequestParam requestParam = new RequestParam.Builder()
|
|
|
-// .serialNumber(request.getHeader("Wechatpay-Serial"))
|
|
|
-// .nonce(request.getHeader("Wechatpay-Nonce"))
|
|
|
-// .signature(request.getHeader("Wechatpay-Signature"))
|
|
|
-// .timestamp(request.getHeader("Wechatpay-Timestamp"))
|
|
|
-// .body(result)
|
|
|
-// .build();
|
|
|
-// String certPath = wxPayV3Config.getCertPath();
|
|
|
-// String seriaNumber = SecurityUtil.getSerialNumber(certPath);
|
|
|
-// NotificationConfig config = new RSAAutoCertificateConfig.Builder()
|
|
|
-// .merchantId(wxPayV3Config.getMchId())
|
|
|
-// .privateKeyFromPath(wxPayV3Config.getKeyPath())
|
|
|
-// .merchantSerialNumber(wxPayV3Config.getSerialNum())
|
|
|
-// .apiV3Key(wxPayV3Config.getApiKey3())
|
|
|
-// .build();
|
|
|
- // 初始化 NotificationParser
|
|
|
-// NotificationParser parser = new NotificationParser((NotificationConfig) config);
|
|
|
-// try {
|
|
|
-// // 以支付通知回调为例,验签、解密并转换成 Transaction
|
|
|
-// Transaction transaction = parser.parse(requestParam, Transaction.class);
|
|
|
-// } catch (ValidationException e) {
|
|
|
-// // 签名验证失败,返回 401 UNAUTHORIZED 状态码
|
|
|
-// log.error("sign verification failed", e);
|
|
|
-// }
|
|
|
-// Map<String, String> map = new HashMap<>();
|
|
|
-// boolean isHandleSuccess = false;
|
|
|
-//// 如果处理失败,应返回 4xx/5xx 的状态码,例如 500 INTERNAL_SERVER_ERROR
|
|
|
-// if (isHandleSuccess) {
|
|
|
-// response.setStatus(200);
|
|
|
-// map.put("code", "SUCCESS");
|
|
|
-// map.put("message", "SUCCESS");
|
|
|
-// } else {
|
|
|
-// response.setStatus(500);
|
|
|
-// map.put("code", "ERROR");
|
|
|
-// map.put("message", "签名错误");
|
|
|
-// }
|
|
|
-//
|
|
|
-//// 处理成功,返回 200 OK 状态码
|
|
|
+ String readData = PayUtil.readData(request);
|
|
|
+ RequestParam requestParam = new RequestParam.Builder()
|
|
|
+ .serialNumber(request.getHeader("Wechatpay-Serial"))
|
|
|
+ .nonce(request.getHeader("Wechatpay-Nonce"))
|
|
|
+ .signature(request.getHeader("Wechatpay-Signature"))
|
|
|
+ .timestamp(request.getHeader("Wechatpay-Timestamp"))
|
|
|
+ .body(readData)
|
|
|
+ .build();
|
|
|
+ NotificationConfig config = new RSAAutoCertificateConfig.Builder()
|
|
|
+ .merchantId(wxPayV3Config.getMchId())
|
|
|
+ .privateKeyFromPath(wxPayV3Config.getKeyPath())
|
|
|
+ .merchantSerialNumber(wxPayV3Config.getSerialNum())
|
|
|
+ .apiV3Key(wxPayV3Config.getApiKey3())
|
|
|
+ .build();
|
|
|
+// 初始化 NotificationParser
|
|
|
+ NotificationParser parser = new NotificationParser((NotificationConfig) config);
|
|
|
+ try {
|
|
|
+ // 以支付通知回调为例,验签、解密并转换成 Transaction
|
|
|
+ Transaction transaction = parser.parse(requestParam, Transaction.class);
|
|
|
+ log.info("支付回调请求返回"+transaction.toString());
|
|
|
+ //回调成功业务没写
|
|
|
+ } catch (Exception e) {
|
|
|
+ // 签名验证失败,返回 401 UNAUTHORIZED 状态码
|
|
|
+ log.error("支付回调请求失败", e);
|
|
|
+ }
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ boolean isHandleSuccess = true;
|
|
|
+// 如果处理失败,应返回 4xx/5xx 的状态码,例如 500 INTERNAL_SERVER_ERROR
|
|
|
+ if (isHandleSuccess) {
|
|
|
+ response.setStatus(200);
|
|
|
+ map.put("code", "SUCCESS");
|
|
|
+ map.put("message", "SUCCESS");
|
|
|
+ } else {
|
|
|
+ response.setStatus(500);
|
|
|
+ map.put("code", "ERROR");
|
|
|
+ map.put("message", "签名错误");
|
|
|
+ }
|
|
|
+
|
|
|
+// 处理成功,返回 200 OK 状态码
|
|
|
// response.setHeader("Content-type", "application/json");
|
|
|
// ObjectMapper mapper = new ObjectMapper();
|
|
|
// response.getOutputStream().write(mapper.writeValueAsString(map).getBytes(StandardCharsets.UTF_8));
|
|
|
// response.flushBuffer();
|
|
|
-
|
|
|
- String inputLine = "";
|
|
|
- String notityXml = "";
|
|
|
- try {
|
|
|
-
|
|
|
- String timestamp = request.getHeader("Wechatpay-Timestamp");
|
|
|
- String nonce = request.getHeader("Wechatpay-Nonce");
|
|
|
- String serialNo = request.getHeader("Wechatpay-Serial");
|
|
|
- String signature = request.getHeader("Wechatpay-Signature");
|
|
|
-
|
|
|
- // 通知密文
|
|
|
- String result = PayUtil.readData(request);
|
|
|
-
|
|
|
- // 需要通过证书序列号查找对应的证书,verifyNotify 中有验证证书的序列号,获取通知明文
|
|
|
- String plainText = WechatPayV3Util.verifyNotify(serialNo, result, signature, nonce, timestamp,
|
|
|
- wxPayV3Config.getApiKey3(), wxPayV3Config.getPlatformCertPath());
|
|
|
-
|
|
|
-
|
|
|
- log.info("微信支付异步通知:【{}】", plainText);
|
|
|
-
|
|
|
- while ((inputLine = request.getReader().readLine()) != null) {
|
|
|
- notityXml += inputLine;
|
|
|
- }
|
|
|
- //关闭流
|
|
|
- request.getReader().close();
|
|
|
- System.out.println("微信回调内容信息:" + notityXml);
|
|
|
- //解析成json
|
|
|
- JSONObject data = JSONObject.parseObject(notityXml);
|
|
|
- //判断 支付是否成功
|
|
|
- if ("TRANSACTION.SUCCESS".equals(data.get("event_type"))) {
|
|
|
-
|
|
|
- // 在这里处理接收到的支付结果通知数据
|
|
|
- Map<String, Object> resourceMap = handlePaymentNotification(data);
|
|
|
-
|
|
|
- // 获取 trade_state 值
|
|
|
- String tradeState = resourceMap.get("trade_state").toString();
|
|
|
- if (tradeState.equals("SUCCESS")) {
|
|
|
- // 获取 amount 字段
|
|
|
- Map<String, Object> amountMap = (Map<String, Object>) resourceMap.get("amount");
|
|
|
- //获得 返回的商户订单号
|
|
|
- String outTradeNo = resourceMap.get("out_trade_no").toString();
|
|
|
-// 微信支付订单号
|
|
|
- String transactionId = resourceMap.get("transaction_id").toString();
|
|
|
-
|
|
|
- String attach = resourceMap.get("attach").toString();
|
|
|
- String total_fee = amountMap.get("payer_total").toString();
|
|
|
- //业务逻辑------------
|
|
|
- LambdaQueryWrapper<HouseOrder> wrapperHo = new LambdaQueryWrapper<>();
|
|
|
- wrapperHo.eq(HouseOrder::getHouseOrderNumber, outTradeNo);
|
|
|
- HouseOrder rr = houseOrderService.getOne(wrapperHo);
|
|
|
- if (ObjectUtils.isNotEmpty(rr)) {
|
|
|
- LambdaQueryWrapper<PayRecord> wrapperPr = new LambdaQueryWrapper<>();
|
|
|
- wrapperPr.eq(PayRecord::getHouseOrderId, rr.getId());
|
|
|
- PayRecord rpr = payRecordService.getOne(wrapperPr);
|
|
|
- if (rpr == null) {
|
|
|
- // 保存支付信息
|
|
|
- rpr = new PayRecord();
|
|
|
- rpr.setHouseOrderId(rr.getId());
|
|
|
- rpr.setUserId(Integer.valueOf(rr.getReserveUserId()));
|
|
|
- rpr.setPayNo(transactionId);
|
|
|
- System.out.println("回调的金额:" + total_fee);
|
|
|
- rpr.setPayPrice(new BigDecimal(total_fee).divide(new BigDecimal("100")).setScale(2));
|
|
|
- rpr.setIsSuccess(ePayStatu.Paysuccess.getValue());
|
|
|
- rpr.setRemark("微信支付支付成功");
|
|
|
- Boolean insertRpr = payRecordService.save(rpr);
|
|
|
- if (!insertRpr) {
|
|
|
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("code", "FAIL");
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- response.getWriter().write(jsonObject.toJSONString());
|
|
|
- }
|
|
|
-
|
|
|
- } else if (rpr.getIsSuccess() != ePayStatu.Paysuccess.getValue()) {
|
|
|
- rpr.setPayNo(transactionId);
|
|
|
- System.out.println("回调的金额:" + total_fee);
|
|
|
- rpr.setPayPrice(new BigDecimal(total_fee).divide(new BigDecimal("100")).setScale(2));
|
|
|
- rpr.setIsSuccess(ePayStatu.Paysuccess.getValue());
|
|
|
- rpr.setRemark(rpr.getRemark() + "微信支付支付成功");
|
|
|
- Boolean updateRpr = payRecordService.updateById(rpr);
|
|
|
- if (!updateRpr) {
|
|
|
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("code", "FAIL");
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- response.getWriter().write(jsonObject.toJSONString());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- // 返回成功响应
|
|
|
- rr.setOrderStatus("2");
|
|
|
-// 支付时间
|
|
|
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- rr.setPayTime(LocalDateTime.now().format(dateTimeFormatter));
|
|
|
-// 支付渠道
|
|
|
- rr.setOrderChannel("1");
|
|
|
-// 支付人
|
|
|
- rr.setPayUserId(rr.getReserveUserId());
|
|
|
- Boolean updateHouseOrder = houseOrderService.updateById(rr);
|
|
|
- if (!updateHouseOrder) {
|
|
|
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("code", "FAIL");
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- response.getWriter().write(jsonObject.toJSONString());
|
|
|
- }
|
|
|
-
|
|
|
- response.setStatus(HttpServletResponse.SC_OK);
|
|
|
- response.getWriter().write("OK");
|
|
|
-
|
|
|
- } else {
|
|
|
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("code", "FAIL");
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- response.getWriter().write(jsonObject.toJSONString());
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("code", "FAIL");
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- response.getWriter().write(jsonObject.toJSONString());
|
|
|
- }
|
|
|
+//
|
|
|
+// String inputLine = "";
|
|
|
+// String notityXml = "";
|
|
|
+// try {
|
|
|
+//
|
|
|
+// String timestamp = request.getHeader("Wechatpay-Timestamp");
|
|
|
+// String nonce = request.getHeader("Wechatpay-Nonce");
|
|
|
+// String serialNo = request.getHeader("Wechatpay-Serial");
|
|
|
+// String signature = request.getHeader("Wechatpay-Signature");
|
|
|
+//
|
|
|
+// // 通知密文
|
|
|
+// String result = PayUtil.readData(request);
|
|
|
+//
|
|
|
+// // 需要通过证书序列号查找对应的证书,verifyNotify 中有验证证书的序列号,获取通知明文
|
|
|
+// String plainText = WechatPayV3Util.verifyNotify(serialNo, result, signature, nonce, timestamp,
|
|
|
+// wxPayV3Config.getApiKey3(), wxPayV3Config.getPlatformCertPath());
|
|
|
+//
|
|
|
+//
|
|
|
+// log.info("微信支付异步通知:【{}】", plainText);
|
|
|
+//
|
|
|
+// while ((inputLine = request.getReader().readLine()) != null) {
|
|
|
+// notityXml += inputLine;
|
|
|
+// }
|
|
|
+// //关闭流
|
|
|
+// request.getReader().close();
|
|
|
+// System.out.println("微信回调内容信息:" + notityXml);
|
|
|
+// //解析成json
|
|
|
+// JSONObject data = JSONObject.parseObject(notityXml);
|
|
|
+// //判断 支付是否成功
|
|
|
+// if ("TRANSACTION.SUCCESS".equals(data.get("event_type"))) {
|
|
|
+//
|
|
|
+// // 在这里处理接收到的支付结果通知数据
|
|
|
+// Map<String, Object> resourceMap = handlePaymentNotification(data);
|
|
|
+//
|
|
|
+// // 获取 trade_state 值
|
|
|
+// String tradeState = resourceMap.get("trade_state").toString();
|
|
|
+// if (tradeState.equals("SUCCESS")) {
|
|
|
+// // 获取 amount 字段
|
|
|
+// Map<String, Object> amountMap = (Map<String, Object>) resourceMap.get("amount");
|
|
|
+// //获得 返回的商户订单号
|
|
|
+// String outTradeNo = resourceMap.get("out_trade_no").toString();
|
|
|
+//// 微信支付订单号
|
|
|
+// String transactionId = resourceMap.get("transaction_id").toString();
|
|
|
+//
|
|
|
+// String attach = resourceMap.get("attach").toString();
|
|
|
+// String total_fee = amountMap.get("payer_total").toString();
|
|
|
+// //业务逻辑------------
|
|
|
+// LambdaQueryWrapper<HouseOrder> wrapperHo = new LambdaQueryWrapper<>();
|
|
|
+// wrapperHo.eq(HouseOrder::getHouseOrderNumber, outTradeNo);
|
|
|
+// HouseOrder rr = houseOrderService.getOne(wrapperHo);
|
|
|
+// if (ObjectUtils.isNotEmpty(rr)) {
|
|
|
+// LambdaQueryWrapper<PayRecord> wrapperPr = new LambdaQueryWrapper<>();
|
|
|
+// wrapperPr.eq(PayRecord::getHouseOrderId, rr.getId());
|
|
|
+// PayRecord rpr = payRecordService.getOne(wrapperPr);
|
|
|
+// if (rpr == null) {
|
|
|
+// // 保存支付信息
|
|
|
+// rpr = new PayRecord();
|
|
|
+// rpr.setHouseOrderId(rr.getId());
|
|
|
+// rpr.setUserId(Integer.valueOf(rr.getReserveUserId()));
|
|
|
+// rpr.setPayNo(transactionId);
|
|
|
+// System.out.println("回调的金额:" + total_fee);
|
|
|
+// rpr.setPayPrice(new BigDecimal(total_fee).divide(new BigDecimal("100")).setScale(2));
|
|
|
+// rpr.setIsSuccess(ePayStatu.Paysuccess.getValue());
|
|
|
+// rpr.setRemark("微信支付支付成功");
|
|
|
+// Boolean insertRpr = payRecordService.save(rpr);
|
|
|
+// if (!insertRpr) {
|
|
|
+// response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
+// JSONObject jsonObject = new JSONObject();
|
|
|
+// jsonObject.put("code", "FAIL");
|
|
|
+// jsonObject.put("message", "失败");
|
|
|
+// response.getWriter().write(jsonObject.toJSONString());
|
|
|
+// }
|
|
|
+//
|
|
|
+// } else if (rpr.getIsSuccess() != ePayStatu.Paysuccess.getValue()) {
|
|
|
+// rpr.setPayNo(transactionId);
|
|
|
+// System.out.println("回调的金额:" + total_fee);
|
|
|
+// rpr.setPayPrice(new BigDecimal(total_fee).divide(new BigDecimal("100")).setScale(2));
|
|
|
+// rpr.setIsSuccess(ePayStatu.Paysuccess.getValue());
|
|
|
+// rpr.setRemark(rpr.getRemark() + "微信支付支付成功");
|
|
|
+// Boolean updateRpr = payRecordService.updateById(rpr);
|
|
|
+// if (!updateRpr) {
|
|
|
+// response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
+// JSONObject jsonObject = new JSONObject();
|
|
|
+// jsonObject.put("code", "FAIL");
|
|
|
+// jsonObject.put("message", "失败");
|
|
|
+// response.getWriter().write(jsonObject.toJSONString());
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 返回成功响应
|
|
|
+// rr.setOrderStatus("2");
|
|
|
+//// 支付时间
|
|
|
+// DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+// rr.setPayTime(LocalDateTime.now().format(dateTimeFormatter));
|
|
|
+//// 支付渠道
|
|
|
+// rr.setOrderChannel("1");
|
|
|
+//// 支付人
|
|
|
+// rr.setPayUserId(rr.getReserveUserId());
|
|
|
+// Boolean updateHouseOrder = houseOrderService.updateById(rr);
|
|
|
+// if (!updateHouseOrder) {
|
|
|
+// response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
+// JSONObject jsonObject = new JSONObject();
|
|
|
+// jsonObject.put("code", "FAIL");
|
|
|
+// jsonObject.put("message", "失败");
|
|
|
+// response.getWriter().write(jsonObject.toJSONString());
|
|
|
+// }
|
|
|
+//
|
|
|
+// response.setStatus(HttpServletResponse.SC_OK);
|
|
|
+// response.getWriter().write("OK");
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
+// JSONObject jsonObject = new JSONObject();
|
|
|
+// jsonObject.put("code", "FAIL");
|
|
|
+// jsonObject.put("message", "失败");
|
|
|
+// response.getWriter().write(jsonObject.toJSONString());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
|
+// JSONObject jsonObject = new JSONObject();
|
|
|
+// jsonObject.put("code", "FAIL");
|
|
|
+// jsonObject.put("message", "失败");
|
|
|
+// response.getWriter().write(jsonObject.toJSONString());
|
|
|
+// }
|
|
|
|
|
|
|
|
|
}
|