|
@@ -22,6 +22,7 @@ import com.wechat.pay.java.core.notification.RequestParam;
|
|
|
import com.wechat.pay.java.service.payments.model.Transaction;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -179,11 +180,11 @@ public class WebsiteUserOrderService extends CrudService<WebsiteUserOrderDao, We
|
|
|
return R.fail("支付调用第三方失败");
|
|
|
}
|
|
|
super.save(websiteUserOrder);
|
|
|
- return R.ok(payResult);
|
|
|
+ return R.ok("成功", payResult);
|
|
|
}
|
|
|
|
|
|
public String generateOrderNumber() {
|
|
|
- String random = String.valueOf((new Random().nextDouble() * 9000) + 1000);
|
|
|
+ String random = String.valueOf(new Random().nextInt(9000) + 1000);
|
|
|
return "WUO" + DateUtils.formatDate(new Date(), "yyyyMMddHHmmss") + random;
|
|
|
}
|
|
|
|
|
@@ -254,12 +255,11 @@ public class WebsiteUserOrderService extends CrudService<WebsiteUserOrderDao, We
|
|
|
}
|
|
|
}
|
|
|
//查是否超时
|
|
|
- if (DateUtils.getMinDistanceOfTwoDate(order.getCreateDate(), new Date()) > 10){
|
|
|
- if (alipayUtil.payClose(order.getOrderNumber())) {
|
|
|
- //支付宝订单关闭成功
|
|
|
- order.setPayStatus(Constants.orderPayStatus.PAY_ERROR);
|
|
|
- super.update(order);
|
|
|
- }
|
|
|
+ if (DateUtils.getMinDistanceOfTwoDate(order.getCreateDate(), new Date()) > 10) {
|
|
|
+ alipayUtil.payClose(order.getOrderNumber());
|
|
|
+ //支付宝订单关闭成功
|
|
|
+ order.setPayStatus(Constants.orderPayStatus.PAY_ERROR);
|
|
|
+ super.update(order);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("zfbPayQuery payQuery error", e);
|