|
@ -0,0 +1,120 @@
|
|
|
package com.yihu.jw.door.controller.doctor;
|
|
|
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
|
|
|
import com.yihu.jw.door.controller.BaseController;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
/**
|
|
|
* Created by yeshijie on 2020/12/30.
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/doctor", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "医生端-基础信息")
|
|
|
public class DoctorController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private BaseDoctorDao doctorDao;
|
|
|
@Autowired
|
|
|
private BaseDoctorHospitalDao doctorHospitalDao;
|
|
|
|
|
|
/**
|
|
|
* 医生基本信息查询接口
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation("医生基本信息查询接口")
|
|
|
@GetMapping(value = "baseinfo")
|
|
|
public String baseinfo(
|
|
|
@RequestParam(required = false) String code) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(code)) {
|
|
|
code = getUID();
|
|
|
}
|
|
|
BaseDoctorDO temp = doctorDao.findById(code);
|
|
|
// Integer leader = doctorAdminTeamDao.findLeader(code);
|
|
|
// Hospital hospital = hospitalDao.findByCode(temp.getHospital());
|
|
|
if (temp != null) {
|
|
|
JSONObject json = new JSONObject();
|
|
|
// 设置区县code
|
|
|
// json.put("town", temp.getTown());
|
|
|
// 设置医生手机号码
|
|
|
json.put("mobile", temp.getMobile());
|
|
|
// 设置医生标识
|
|
|
json.put("code", temp.getId());
|
|
|
// 设置医生姓名
|
|
|
json.put("name", temp.getName());
|
|
|
// 设置医生头像
|
|
|
json.put("photo", temp.getPhoto());
|
|
|
// 设置医生性别
|
|
|
json.put("sex", temp.getSex());
|
|
|
// 设置省名称
|
|
|
json.put("provinceName", temp.getProvinceName());
|
|
|
// 设置城市名称
|
|
|
json.put("cityName", temp.getCityName());
|
|
|
// 设置医院名称
|
|
|
// json.put("hospitalName", temp.getHospitalName());
|
|
|
// 设置医院
|
|
|
// json.put("hospital", temp.getHospital());
|
|
|
// 设置医院等级1.三甲,2.二甲,3.1级以下
|
|
|
// json.put("hosLevel", hospital.getHosLevel());
|
|
|
// 设置部门名称
|
|
|
// json.put("deptName", StringUtils.isNotEmpty(temp.getDeptName()) ? temp.getDeptName() : "");
|
|
|
// 设置职称code
|
|
|
json.put("jobCode", StringUtils.isNotEmpty(temp.getJobTitleCode()) ? temp.getJobTitleCode() : "");
|
|
|
// 设置职称
|
|
|
json.put("jobName", StringUtils.isNotEmpty(temp.getJobTitleName()) ? temp.getJobTitleName() : "");
|
|
|
// 设置医生专长
|
|
|
json.put("expertise", StringUtils.isNotEmpty(temp.getExpertise()) ? temp.getExpertise() : "");
|
|
|
// 设置医生简介
|
|
|
json.put("introduce", StringUtils.isNotEmpty(temp.getIntroduce()) ? temp.getIntroduce() : "");
|
|
|
// 二维码地址
|
|
|
json.put("qrcode", temp.getQrcode());
|
|
|
// 咨询统计
|
|
|
// Map<String, Long> consultCount = consultTeamService.getAllCount(code);
|
|
|
// 咨询总数
|
|
|
// json.put("consultAmount", consultCount.get("all"));
|
|
|
// // 当天咨询数
|
|
|
// json.put("consultAmountToday", consultCount.get("today"));
|
|
|
//身份类型
|
|
|
json.put("level", "1");
|
|
|
//身份证号
|
|
|
json.put("idcard", temp.getIdcard());
|
|
|
//是否认证
|
|
|
json.put("isCertified", temp.getIscertified());
|
|
|
//是否名医
|
|
|
json.put("isFamous", temp.getIsFamous());
|
|
|
//是否医生提示 提示过是1 其他都是0
|
|
|
json.put("isPasswordPrompt", StringUtils.isEmpty(temp.getIsPasswordPrompt()) ? "0" : temp.getIsPasswordPrompt());
|
|
|
//获取医生角色和区域权限
|
|
|
// List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(temp.getCode());
|
|
|
// json.put("userRole", roleMap);
|
|
|
|
|
|
//获取医生后台管理员系统角色,用于判断是否是居民上门服务业务中的调度员
|
|
|
// json.put("doctorRole",roleService.findManageUserRole(temp.getCode()));
|
|
|
// 是否团队长
|
|
|
// json.put("isLeader", leader == null ? "0" : "1");
|
|
|
// 团队长所管辖的团队code 一个团队长只管辖一个团队
|
|
|
// json.put("adminTeamCode", leader);
|
|
|
|
|
|
|
|
|
return write(200, "医生信息查询成功!", "data", json);
|
|
|
} else {
|
|
|
return error(-1, "医生信息查询失败!");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "医生信息查询失败!");
|
|
|
}
|
|
|
}
|
|
|
}
|