| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.ruoyi.basic.mapper.CustomerReturnVisitMapper; |
| | | import com.ruoyi.basic.pojo.CustomerReturnVisit; |
| | | import com.ruoyi.basic.service.CustomerReturnVisitService; |
| | | import com.ruoyi.framework.redis.RedisCache; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.ZoneId; |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ReturnVisitReminderService { |
| | | |
| | | private static final String REMINDER_QUEUE_KEY = "return_visit:reminder:queue"; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | private final RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private CustomerReturnVisitService customerReturnVisitService; |
| | | private final CustomerReturnVisitMapper customerReturnVisitMapper; |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public void scheduleReminder(Long returnVisitId) { |
| | | CustomerReturnVisit returnVisit = customerReturnVisitService.getById(returnVisitId); |
| | | CustomerReturnVisit returnVisit = customerReturnVisitMapper.selectById(returnVisitId); |
| | | if (returnVisit == null || returnVisit.getIsEnabled() == 0) { |
| | | return; |
| | | } |