| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.customervisits.dto.CustomerVisitsDto; |
| | | import com.ruoyi.customervisits.mapper.CustomerVisitsMapper; |
| | | import com.ruoyi.customervisits.pojo.CustomerVisits; |
| | | import com.ruoyi.customervisits.service.CustomerVisitsService; |
| | | import com.ruoyi.quality.pojo.QualityUnqualified; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | @Autowired |
| | | private CustomerVisitsMapper customerVisitsMapper; |
| | | |
| | | @Autowired |
| | | private CommonFileMapper commonFileMapper; |
| | | |
| | | @Override |
| | | public IPage<CustomerVisits> listPage(Page page, CustomerVisits customerVisits) { |
| | | LambdaQueryWrapper<CustomerVisits> wrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | if (customerVisits != null) { |
| | | if (StringUtils.hasText(customerVisits.getCustomerName())) { |
| | | wrapper.like(CustomerVisits::getCustomerName, customerVisits.getCustomerName()); |
| | | } |
| | | |
| | | if (StringUtils.hasText(customerVisits.getVisitingPeople())) { |
| | | wrapper.like(CustomerVisits::getVisitingPeople, customerVisits.getVisitingPeople()); |
| | | } |
| | | public IPage<CustomerVisitsDto> listPage(Page page, CustomerVisits customerVisits) { |
| | | IPage<CustomerVisitsDto> selectPage = customerVisitsMapper.listPage(page, customerVisits); |
| | | for (CustomerVisitsDto record : selectPage.getRecords()) { |
| | | List<CommonFile> allFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, record.getId()) |
| | | .eq(CommonFile::getType, FileNameType.CUSTOMER_VISITS.getValue())); |
| | | record.setCommonFileList(allFiles); |
| | | } |
| | | |
| | | return customerVisitsMapper.selectPage(page, wrapper); |
| | | return selectPage; |
| | | } |
| | | |
| | | @Override |