tj
2025-04-01 16c60b7e3b834b05599882ab1ffe99ec78664762
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,15 @@
        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);
    }
}