From 7754978cbd8225370dd35d047f64a4643105a19a Mon Sep 17 00:00:00 2001 From: "geng.tang@qq.com" Date: Mon, 29 Jan 2024 18:58:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=AF=E4=BB=98=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=8E=A5=E5=8F=A3=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/controller/PaymentController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gxwebsoft/shop/controller/PaymentController.java b/src/main/java/com/gxwebsoft/shop/controller/PaymentController.java index c20bac2..5a2a581 100644 --- a/src/main/java/com/gxwebsoft/shop/controller/PaymentController.java +++ b/src/main/java/com/gxwebsoft/shop/controller/PaymentController.java @@ -375,17 +375,16 @@ public class PaymentController extends BaseController { Order parentOrder = orderService.getById(order.getRentOrderId()); parentOrder.setCurrPeriods(parentOrder.getCurrPeriods() + 1); - order.setCurrPeriods(parentOrder.getCurrPeriods()); - order.setBatteryRent(parentOrder.getBatteryRent()); - parentOrder.setPayStatus(PAY_STATUS_SUCCESS); // 更新过期时间延长一个月 // 保存续费订单状态 if (parentOrder.getCurrPeriods() >= parentOrder.getPeriods()) { - SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - String format = sf.format(DateUtil.offset(new Date(), DateField.MONTH, 1200)); - Date parse = sf.parse(format); +// SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); +// String format = sf.format(DateUtil.offset(new Date(), DateField.MONTH, 1200)); +// Date parse = sf.parse(format); + DateTime dt = DateUtil.offset(new Date(), DateField.MONTH, 1200); + Date parse = dt.toJdkDate(); parentOrder.setOrderStatus(ORDER_STATUS_OVER); parentOrder.setExpirationTime(parse); @@ -398,6 +397,8 @@ public class PaymentController extends BaseController { parentOrder.setExpirationTime(order.getExpirationTime()); } + order.setCurrPeriods(parentOrder.getCurrPeriods()); + order.setBatteryRent(parentOrder.getBatteryRent()); orderPayService.updateById(order); orderService.updateById(parentOrder); return "success";