|
@ -46,6 +46,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@ -97,6 +98,53 @@ public class DoctorController extends BaseController {
|
|
|
@Autowired
|
|
|
private RSAUtils rsaUtils;
|
|
|
|
|
|
@ApiOperation("获取当前登录医生的角色")
|
|
|
@RequestMapping(value = "doctorRole",method =RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public String doctorRole(){
|
|
|
try{
|
|
|
Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("id", doctor.getId());
|
|
|
map.put("uid", doctor.getCode());
|
|
|
map.put("name", doctor.getName());
|
|
|
map.put("hospital", doctor.getHospital());
|
|
|
map.put("hospitalName", doctor.getHospitalName());
|
|
|
map.put("photo", doctor.getPhoto());
|
|
|
// 设置医生类型:1专科医生,2全科医生,3健康管理师
|
|
|
map.put("doctorType", doctor.getLevel());
|
|
|
//获取医生角色和区域权限
|
|
|
List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(doctor.getCode());
|
|
|
map.put("userRole", roleMap);
|
|
|
//医生当前登录的角色
|
|
|
if(roleMap.size()>0){
|
|
|
|
|
|
for(Map<String, String> one:roleMap){
|
|
|
if("1".equals(one.get("isManage"))){
|
|
|
map.put("currentUserRole", one);
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
Map<String, String> one = new HashMap<>();
|
|
|
one.put("isManage","0");
|
|
|
one.put("code", doctor.getHospital());
|
|
|
one.put("name", doctor.getHospitalName());
|
|
|
one.put("areas", "");
|
|
|
one.put("level","4");
|
|
|
one.put("authOperate", "0");
|
|
|
map.put("currentUserRole", one);
|
|
|
}
|
|
|
if ("10" .equals(doctor.getLevel()) && roleMap.size() == 0) {
|
|
|
return error(-1, "该用户没有管理员权限");
|
|
|
}
|
|
|
return write(200, "登录成功", "data", map);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return error(-1,"查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 社区医院下医生列表查询接口 没分页
|