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";