取消租电订单同步
This commit is contained in:
@ -412,11 +412,6 @@ public class WechatPayService {
|
||||
|
||||
if(OrderStatus.equals("WAIT_PAY")){
|
||||
orderPayMapper.updateOrderStatus(orderMain.getOrderNo(),"WAIT_PICK");
|
||||
String subOrderId = orderPayMapper.getSubOrderIdByTradeNo(outTradeNo).toString();
|
||||
if (!subOrderId.isEmpty()) {
|
||||
String result = sendSubOrderId(subOrderId);
|
||||
logger.info("调用subOrder接口结果: {}", result);
|
||||
}
|
||||
}else if (OrderStatus.equals("RERENT_WAIT_PAY")){
|
||||
OrderSub orderSub = orderPayMapper.getSubOrderByTradeNo(outTradeNo);
|
||||
orderPayMapper.updateOrderStatusAndEndRentTime(orderMain.getOrderNo(),orderSub.getReturnTime(),orderMain.getOverdueDays(),orderMain.getOrderAmount().add(orderSub.getAmount()),"RENT_ING");
|
||||
@ -565,49 +560,4 @@ public class WechatPayService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送subOrderId到指定接口
|
||||
* @param subOrderId 子订单ID
|
||||
* @return 响应结果
|
||||
*/
|
||||
public String sendSubOrderId(String subOrderId) {
|
||||
try {
|
||||
// 构造完整的URL,将subOrderId作为参数传递
|
||||
String url = "http://115.190.8.52:8016/send/subOrder/" + subOrderId;
|
||||
|
||||
// 创建URL对象
|
||||
java.net.URL obj = new java.net.URL(url);
|
||||
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) obj.openConnection();
|
||||
|
||||
// 设置请求方法为GET
|
||||
connection.setRequestMethod("GET");
|
||||
|
||||
// 设置连接超时和读取超时
|
||||
connection.setConnectTimeout(5000);
|
||||
connection.setReadTimeout(5000);
|
||||
|
||||
// 获取响应码
|
||||
int responseCode = connection.getResponseCode();
|
||||
logger.info("发送subOrderId请求,URL: {}, 响应码: {}", url, responseCode);
|
||||
|
||||
// 读取响应内容
|
||||
java.io.BufferedReader in = new java.io.BufferedReader(
|
||||
new java.io.InputStreamReader(connection.getInputStream())
|
||||
);
|
||||
String inputLine;
|
||||
StringBuilder response = new StringBuilder();
|
||||
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
in.close();
|
||||
|
||||
return response.toString();
|
||||
} catch (Exception e) {
|
||||
logger.error("发送subOrderId到接口失败,subOrderId: {}", subOrderId, e);
|
||||
return "ERROR: " + e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user