| | |
| | | import com.ruoyi.basic.service.CustomerReturnVisitService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | * @since 2026/03/04 17:58 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class CustomerReturnVisitServiceImpl extends ServiceImpl<CustomerReturnVisitMapper, CustomerReturnVisit> implements CustomerReturnVisitService { |
| | | |
| | | @Autowired |
| | | private ReturnVisitReminderService returnVisitReminderService; |
| | | private final ReturnVisitReminderService returnVisitReminderService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | throw new ServiceException("客户ID不能为空"); |
| | | } |
| | | LambdaQueryWrapper<CustomerReturnVisit> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(CustomerReturnVisit::getCustomerPrivatePoolId, customerId); |
| | | queryWrapper.eq(CustomerReturnVisit::getCustomerId, customerId); |
| | | CustomerReturnVisit returnVisit = baseMapper.selectOne(queryWrapper); |
| | | |
| | | if (returnVisit == null) { |
| | |
| | | throw new ServiceException("客户ID不能为空"); |
| | | } |
| | | LambdaQueryWrapper<CustomerReturnVisit> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(CustomerReturnVisit::getCustomerPrivatePoolId, customerId); |
| | | queryWrapper.eq(CustomerReturnVisit::getCustomerId, customerId); |
| | | List<CustomerReturnVisit> returnVisits = baseMapper.selectList(queryWrapper); |
| | | |
| | | for (CustomerReturnVisit returnVisit : returnVisits) { |
| | |
| | | if (returnVisit == null) { |
| | | throw new ServiceException("回访提醒数据不能为空"); |
| | | } |
| | | if (returnVisit.getCustomerPrivatePoolId() == null) { |
| | | if (returnVisit.getCustomerId() == null) { |
| | | throw new ServiceException("客户ID不能为空"); |
| | | } |
| | | if (returnVisit.getReminderTime() == null) { |