| | |
| | | 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; |
| | |
| | | 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; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | 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; |
| | | } |
| | | 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); |
| | | } |
| | | } |