fix:优化行程规划分页查询的逻辑

This commit is contained in:
lulz1 2024-07-08 16:17:52 +08:00
parent 60dc853b57
commit 11394fc723
4 changed files with 6 additions and 7 deletions

View File

@ -163,7 +163,8 @@ public class OrderQuery {
Set<String> employeeNoSet = routeOrders.stream().filter(it -> it.getApproveOrderNo() != null) Set<String> employeeNoSet = routeOrders.stream().filter(it -> it.getApproveOrderNo() != null)
.flatMap(it -> Stream.of(it.getUserId(), it.getApproveOrderNo().getCreator())) .flatMap(it -> Stream.of(it.getUserId(), it.getApproveOrderNo().getCreator()))
.collect(Collectors.toSet()); .collect(Collectors.toSet());
Map<String, User> userMap = userRepository.findByEmployeeNoIn(employeeNoSet) List<User> byEmployeeNoIn = userRepository.findByEmployeeNoIn(employeeNoSet);
Map<String, User> userMap = byEmployeeNoIn
.stream() .stream()
.collect(Collectors.toMap(User::getEmployeeNo, Function.identity())); .collect(Collectors.toMap(User::getEmployeeNo, Function.identity()));
List<RouteOrderPageRes> orders = routeOrders List<RouteOrderPageRes> orders = routeOrders

View File

@ -149,7 +149,7 @@ public abstract class AbstractGenericRepository<T, ID> {
} }
// Step 5: Return the complete list // Step 5: Return the complete list
return inCacheList; return inCacheList.stream().filter(Objects::nonNull).collect(Collectors.toList());
} }
public List<T> findByFieldsIn(String fieldPrefix, public List<T> findByFieldsIn(String fieldPrefix,

View File

@ -247,6 +247,4 @@ public class BatchUserWorker {
} }
return list.isEmpty(); return list.isEmpty();
} }
} }

View File

@ -313,9 +313,9 @@ class RouteApplicationTests {
@Test @Test
void loginSign() { void loginSign() {
String sfno = "221108016"; String sfno = "230615020";
String syscode = "FSSC"; String syscode = "FSSC";
String billcode = "CLSQ240620004123"; String billcode = "CLSQ240225000099";
String companycode = "正泰集团股份有限公司"; String companycode = "正泰集团股份有限公司";
String timespan = "1708908662738"; String timespan = "1708908662738";
String s = Digest.md5(sfno + syscode + billcode + companycode + LOGIN_SECRET_KEY + timespan); String s = Digest.md5(sfno + syscode + billcode + companycode + LOGIN_SECRET_KEY + timespan);
@ -324,7 +324,7 @@ class RouteApplicationTests {
@Test @Test
void loginSignProd() { void loginSignProd() {
String sfno = "231026051"; String sfno = "230615020";
String syscode = "FSSC"; String syscode = "FSSC";
String billcode = "CLSQ240225000099"; String billcode = "CLSQ240225000099";
String companycode = "正泰集团股份有限公司"; String companycode = "正泰集团股份有限公司";