|
|
@@ -14,7 +14,9 @@ import com.lianda.backend.repository.BusCustomerCustomerTypeRepository;
|
|
|
import com.lianda.backend.repository.DispPortRepository;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
@@ -111,12 +113,13 @@ public class CommonDataService {
|
|
|
|
|
|
// 查询对应的客户公司信息(支持模糊搜索和分页)
|
|
|
Page<BusCustomerCompany> companyPage;
|
|
|
- Sort sort = Sort.by(Sort.Direction.ASC, "name");
|
|
|
if (companyName != null && !companyName.isEmpty()) {
|
|
|
companyPage = busCustomerCompanyRepository.findByNameContainingAndRecordStatus(
|
|
|
companyName, 1, pageable);
|
|
|
} else {
|
|
|
- companyPage = busCustomerCompanyRepository.findByRecordStatus(1, pageable, sort);
|
|
|
+ Sort sort = Sort.by(Sort.Direction.ASC, "name");
|
|
|
+ Pageable sortedPageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sort);
|
|
|
+ companyPage = busCustomerCompanyRepository.findByRecordStatus(1, sortedPageable);
|
|
|
}
|
|
|
|
|
|
// 过滤出船公司类型的数据并转换为DTO
|