Commit 629e1bfb by chenzy

【新增】用户,组织相关

parent 23882f88
......@@ -113,8 +113,10 @@ public class DataSyncActor extends AbstractActor {
try {
map = objectMapper.readValue(rows.toString(), Map.class);
String deptid = (String)map.get("DEPTID");
String username = (String)map.get("NAME");
String deptName = orgMapIdAndName.get(deptid);
map.put("DEPT_NAME", deptName);
map.put("search", username + ":" + ":" + deptName);
urlList.add(map);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
......
......@@ -123,10 +123,16 @@ public class SyncDataController {
}
@GetMapping("/getAllSyncUser")
public List<Document> getAllSyncUser() {
public Page<Document> getAllSyncUser(@RequestParam(required = false) String search, @RequestParam(defaultValue = "0") Integer pageNumber, @RequestParam(defaultValue = "10") Integer pageSize) {
Query query = new Query();
query.fields().exclude("_id");
if (search != null && !search.isEmpty()) {
query.addCriteria(Criteria.where("search").regex(search));
}
Long total = mongoTemplate.count(query, Document.class, "sync_user_data");
Pageable pageable = PageRequest.of(pageNumber, pageSize);
query.with(pageable);
List<Document> documents = mongoTemplate.find(query, Document.class, "sync_user_data");
return documents;
return PageableExecutionUtils.getPage(documents, pageable, () -> total);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment