添加科室和职称排序
This commit is contained in:
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@RestController("commonTaihuTalent")
|
||||
@@ -34,8 +35,26 @@ public class TaihuTalentController {
|
||||
public R getTaihuTalents(@RequestBody Map<String,Object> params){
|
||||
LambdaQueryWrapper<TaihuTalent> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotEmpty(params.get("name").toString()),TaihuTalent::getName,params.get("name"));
|
||||
wrapper.like(StringUtils.isNotEmpty(params.get("department").toString()),TaihuTalent::getDepartment,params.get("department"));
|
||||
wrapper.like(StringUtils.isNotEmpty(params.get("region").toString()),TaihuTalent::getRegion,params.get("region"));
|
||||
return R.ok().put("list",taihuTalentService.list(wrapper));
|
||||
wrapper.orderByAsc(TaihuTalent::getCreateTime);
|
||||
List<TaihuTalent> list = taihuTalentService.list(wrapper);
|
||||
List<String> titleList = Arrays.asList("主任","副主任","主治医师");
|
||||
list = list.stream().sorted((taihuTalent1,taihuTalent2)->{
|
||||
for (String str:titleList){
|
||||
if (str.equals(taihuTalent1.getTitle())||str.equals(taihuTalent2.getTitle())){
|
||||
if (taihuTalent1.getTitle().equals(taihuTalent2.getTitle())){
|
||||
return 0;
|
||||
}else if (str.equals(taihuTalent1.getTitle())){
|
||||
return -1;
|
||||
}else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}).collect(Collectors.toList());
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
//太湖英才详情
|
||||
|
||||
@@ -21,6 +21,9 @@ public class TaihuTalent implements Serializable {
|
||||
//姓名
|
||||
private String name;
|
||||
|
||||
//科室
|
||||
private String department;
|
||||
|
||||
//职称
|
||||
private String title;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user