| | |
| | | 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; |
| | |
| | | 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(); |
| | | } |
| | | } |