|
@@ -70,15 +70,18 @@ public class WxApiService {
|
|
|
}
|
|
|
if (null != existOrder) {
|
|
|
if (existOrder.getPayStatus() == 1) {
|
|
|
- return CompletableFuture.completedFuture(ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您已成功支付过一笔相同金额的订单,请勿重复支付。"));
|
|
|
+ return CompletableFuture.completedFuture(ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
|
|
|
+ "您已成功支付过一笔相同金额的订单,请勿重复支付。"));
|
|
|
}
|
|
|
- if (existOrder.getPayStatus() == 99 || existOrder.getPayStatus() == 0) {
|
|
|
- if (DateUtil.orderValid(existOrder.getCreateDatetime())) {
|
|
|
- return CompletableFuture.completedFuture(ResultVoUtil.success(existOrder));
|
|
|
+ if (StringUtil.notBlank(existOrder.getPaySign()) && StringUtil.notBlank(existOrder.getPrepayId())) {
|
|
|
+ if (existOrder.getPayStatus() == 99 || existOrder.getPayStatus() == 0) {
|
|
|
+ if (DateUtil.orderValid(existOrder.getCreateDatetime())) {
|
|
|
+ return CompletableFuture.completedFuture(ResultVoUtil.success(existOrder));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (null == param.getYjReqNo()) {
|
|
|
+ param.setYjReqNo(existOrder.getYjReqNo());
|
|
|
}
|
|
|
- }
|
|
|
- if (null == param.getYjReqNo()) {
|
|
|
- param.setYjReqNo(existOrder.getYjReqNo());
|
|
|
}
|
|
|
}
|
|
|
String appId = PropertiesUtil.getProperty("appId");
|
|
@@ -170,11 +173,10 @@ public class WxApiService {
|
|
|
dao.insertNewOrder(order);
|
|
|
log.info("统一下单成功:{}", order);
|
|
|
return CompletableFuture.completedFuture(ResultVoUtil.success(order));
|
|
|
- } else {
|
|
|
- final String message = root.element("return_msg").getStringValue();
|
|
|
- log.info("微信统一下单失败:{}", message);
|
|
|
- return CompletableFuture.completedFuture(ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, message));
|
|
|
}
|
|
|
+ final String message = root.element("return_msg").getStringValue();
|
|
|
+ log.info("微信统一下单失败:{}", message);
|
|
|
+ return CompletableFuture.completedFuture(ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, message));
|
|
|
} catch (DocumentException e) {
|
|
|
e.printStackTrace();
|
|
|
return CompletableFuture.completedFuture(ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, e.getMessage()));
|