|
@@ -85,11 +85,11 @@ public class SampleLisController {
|
|
|
|
|
|
@Operation(summary = "获取机构下医生")
|
|
|
@GetMapping("/dep/doc")
|
|
|
- public R<List<DeptUserItem>> getLisDeptUser(@RequestParam Integer depId, @RequestParam(required = false) String name) {
|
|
|
- String sql = "select hbpu.dep_id, hiue.user_id, hiue.name, hiue.email " +
|
|
|
+ public R<Page<DeptUserItem>> getLisDeptUser(@RequestParam Integer depId, @RequestParam(required = false) String name, Page<?> page) {
|
|
|
+ String sql = "select hbpu.dep_id, hiue.user_id, hiue.name, hiue.contact as phone, hiue.email " +
|
|
|
"from HT_BAS_DEP_USER hbpu " +
|
|
|
"left join HT_INFO_USER_EXTEND hiue on hbpu.USER_ID = hiue.USER_ID " +
|
|
|
- "where hbpu.STATUS =1 and hbpu.DEP_ID =%d and hiue.JOB_LEVEL =1 "; //JOB_LEVEL=1表示医生
|
|
|
+ "where hbpu.STATUS=1 and hbpu.DEP_ID=%d and hiue.JOB_LEVEL=1 "; //JOB_LEVEL=1表示医生
|
|
|
sql = String.format(sql, depId);
|
|
|
if (StrUtil.isNotBlank(name)) {
|
|
|
sql += "and hiue.name like '%" + name + "%'";
|
|
@@ -98,12 +98,19 @@ public class SampleLisController {
|
|
|
List<Entity> entities = lisDb.query(sql);
|
|
|
//lis数据库有重复数据,去重,后面的覆盖前面的
|
|
|
Map<String, Entity> nameMap = entities.stream().collect(Collectors.toMap(entity -> entity.getStr("name"), Function.identity(), (a, b) -> b));
|
|
|
+ if (nameMap.isEmpty()) {
|
|
|
+ return R.ok(new PageDTO<>());
|
|
|
+ }
|
|
|
|
|
|
List<DeptUserItem> items = nameMap.values().stream()
|
|
|
.map(entity -> entity.toBeanWithCamelCase(new DeptUserItem()))
|
|
|
.sorted(Comparator.comparingLong(DeptUserItem::getUserId))
|
|
|
+ .skip(page.offset())
|
|
|
+ .limit(page.getSize())
|
|
|
.collect(Collectors.toList());
|
|
|
- return R.ok(items);
|
|
|
+ Page<DeptUserItem> pageResult = PageDTO.of(page.getCurrent(), page.getSize(), nameMap.size());
|
|
|
+ pageResult.setRecords(items);
|
|
|
+ return R.ok(pageResult);
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "获取字典", description = "type说明:LIS_SEX性别 LIS_SAMPLE_TYPE样本类型 LIS_PET_TYPE动物类型 ")
|