cloudroam
2025-03-31 6a570e438ef2565ade370d9beb73670c5cbc39fc
src/main/java/com/mzl/flower/service/customer/CustomerService.java
@@ -13,6 +13,7 @@
import com.mzl.flower.dto.request.menber.UserGrowthRecordDTO;
import com.mzl.flower.dto.response.customer.CustomerDTO;
import com.mzl.flower.dto.response.partner.PartnerDTO;
import com.mzl.flower.dto.response.supplier.SupplierDTO;
import com.mzl.flower.entity.customer.Customer;
import com.mzl.flower.entity.partner.Partner;
import com.mzl.flower.enums.TrueOrFalseEnum;
@@ -28,6 +29,8 @@
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
@Service
@@ -252,4 +255,13 @@
        return null;
    }
    public CustomerDTO findCustomerByPhone(String phone) {
        CustomerDTO customerByPhone = customerMapper.findCustomerByPhone(phone);
        if (customerByPhone != null && customerByPhone.getMemberOvertime() != null) {
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
            customerByPhone.setMemberOverDate(customerByPhone.getMemberOvertime().format(formatter));
        }
        customerByPhone.setContactTel(phone);
        return customerByPhone;
    }
}