From e2c56f53fcfeb638c35464e9da18b78334daad0f Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期三, 02 四月 2025 14:15:46 +0800
Subject: [PATCH] 1.VIP订单过期检测-每天凌晨一点执行一次

---
 src/main/java/com/mzl/flower/service/customer/CustomerService.java |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/mzl/flower/service/customer/CustomerService.java b/src/main/java/com/mzl/flower/service/customer/CustomerService.java
index 3c04fc6..1331f6e 100644
--- a/src/main/java/com/mzl/flower/service/customer/CustomerService.java
+++ b/src/main/java/com/mzl/flower/service/customer/CustomerService.java
@@ -26,6 +26,7 @@
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 
 import javax.annotation.Resource;
@@ -264,4 +265,20 @@
         customerByPhone.setContactTel(phone);
         return customerByPhone;
     }
+    public Customer getByUserId(String userId) {
+        List<Customer> customers = customerMapper.selectList(new LambdaQueryWrapper<Customer>().eq(Customer::getUserId, userId).eq(Customer::getDeleted, TrueOrFalseEnum.FALSE.isFlag()));
+        if(!CollectionUtils.isEmpty(customers)){
+            return customers.get(0);
+        }
+        return null;
+    }
+
+    public void updateMemberInfo(Customer customer) {
+        customerMapper.updateById(customer);
+    }
+
+    public void checkVipExpireTime() {
+        // 获取当天日期之前,且is_member=1的用户,设置为is_member=0并且将member_overtime设置为null
+        customerMapper.checkVipExpireTime();
+    }
 }

--
Gitblit v1.9.3