| | |
| | | import com.mzl.flower.dto.request.customer.ChangePartnerDTO; |
| | | import com.mzl.flower.dto.request.customer.QueryCustomerDTO; |
| | | import com.mzl.flower.dto.request.customer.UpdateCustomerDTO; |
| | | 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.entity.customer.Customer; |
| | |
| | | import com.mzl.flower.enums.TrueOrFalseEnum; |
| | | import com.mzl.flower.mapper.customer.CustomerMapper; |
| | | import com.mzl.flower.mapper.partner.PartnerMapper; |
| | | import com.mzl.flower.service.menber.MemberGrowthRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | private final CustomerMapper customerMapper; |
| | | |
| | | private final PartnerMapper partnerMapper; |
| | | @Resource |
| | | private MemberGrowthRecordService memberGrowthRecordService; |
| | | |
| | | public CustomerService(CustomerMapper customerMapper, PartnerMapper partnerMapper) { |
| | | this.customerMapper = customerMapper; |
| | |
| | | } |
| | | |
| | | public CustomerDTO getCurrentCustomer() { |
| | | return customerMapper.getCurrentCustomer(SecurityUtils.getUserId()); |
| | | CustomerDTO currentCustomer = customerMapper.getCurrentCustomer(SecurityUtils.getUserId()); |
| | | UserGrowthRecordDTO userGrowthRecordDTO = memberGrowthRecordService.getInfoByUserId(SecurityUtils.getUserId()); |
| | | if(!ObjectUtils.isEmpty(userGrowthRecordDTO)){ |
| | | currentCustomer.setUserGrowthRecord(userGrowthRecordDTO); |
| | | } |
| | | return currentCustomer; |
| | | } |
| | | |
| | | public PartnerDTO getCurrentBindPartner() { |