1.fix update_time autofill
This commit is contained in:
2026-05-13 14:45:25 +08:00
parent d15d4bf363
commit 5561c67e77
3 changed files with 5 additions and 2 deletions

View File

@@ -15,6 +15,8 @@ import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.Date;
@Slf4j
@Component
@@ -43,6 +45,7 @@ public class PaymentListener {
userOrder.setOrderStatus(OrderStatus.PAID.getCode());
userOrder.setPaymentStatus(PaymentStatus.PAID.getCode());
userOrder.setPaymentTime(event.getPayTime());
userOrder.setUpdateTime(new Date());
if ( !commonUserOrderService.updateById(userOrder)){
log.error("支付回调监听 : 订单支付失败 , 订单id : {}" , userOrder.getId());
return;

View File

@@ -432,6 +432,7 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
boolean updated = update(Wrappers.<CommonUserOrderEntity>lambdaUpdate()
.set(CommonUserOrderEntity::getExpressNo, expressNo)
.set(CommonUserOrderEntity::getOrderStatus, OrderStatus.SHIPPED.getCode())
.set(CommonUserOrderEntity::getUpdateTime, new Date())
.eq(CommonUserOrderEntity::getId, id)
.eq(CommonUserOrderEntity::getOrderStatus, OrderStatus.PAID.getCode())
.eq(CommonUserOrderEntity::getPaymentStatus, PaymentStatus.PAID.getCode())
@@ -461,6 +462,7 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
}
boolean updated = update(Wrappers.lambdaUpdate(CommonUserOrderEntity.class)
.set(CommonUserOrderEntity::getOrderStatus, OrderStatus.COMPLETED.getCode())
.set(CommonUserOrderEntity::getUpdateTime, new Date())
.eq(CommonUserOrderEntity::getId, order.getId())
.eq(CommonUserOrderEntity::getOrderStatus, OrderStatus.SHIPPED.getCode()));
if (!updated) {

View File

@@ -26,11 +26,9 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.modules.common.event.PaymentCallbackEvent;
import org.springblade.plugin.pay.constant.PayConstant;
import org.springblade.plugin.pay.entity.Order;
import org.springblade.plugin.pay.mapper.OrderMapper;
import org.springblade.plugin.pay.service.IOrderService;
import org.springblade.plugin.pay.util.OrderUtil;
import org.springblade.plugin.pay.vo.OrderVO;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;