Преглед изворни кода

Merge branches 'dev' and 'master' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

lyr пре 8 година
родитељ
комит
b11c38f343

+ 1 - 1
src/main/java/com/yihu/wlyy/entity/consult/ConsultTeam.java

@ -30,7 +30,7 @@ public class ConsultTeam extends IdEntity {
	private String doctor;
	// 三师团队标识
	private String team;
	//三师咨询,2家庭医生咨询 3.名医咨询
	//1 三师咨询,2家庭医生咨询 6.名医咨询
	private Integer type;
	// 提问者标识
	private String patient;

+ 1 - 1
src/main/java/com/yihu/wlyy/job/Constant.java

@ -84,7 +84,7 @@ public class Constant {
            case "2":{
                return level_disease_2_name;
            }
            case "100":{
            case "3":{
                return level_disease_3_name;
            }
        }

+ 1 - 1
src/main/java/com/yihu/wlyy/job/CurrentDayAllQuotaJob.java

@ -260,7 +260,7 @@ public class CurrentDayAllQuotaJob implements Job {
                        jsonObject.put("num",0);
                    }
                    jsonObject.put("name",townObj.getName());
                    jsonObject.put("date", DateUtil.dateToStrLong(new Date()));
                    jsonObject.put("date", DateUtil.dateToStrLong(new Date()));//quota:12:2:6:1:350200
                    redisTemplate.opsForValue().set(new StringBuffer("quota:12:3:"+i+":"+j+":"+entry.getKey()).toString(),jsonObject.toString());
                }
            }

+ 30 - 25
src/main/java/com/yihu/wlyy/job/SignAgeGroupDiseaseJob.java

@ -119,36 +119,41 @@ public class SignAgeGroupDiseaseJob implements Job {
                boolean hasGXY = false;//有高血压
                boolean hasTNB = false;//有糖尿病
                //如果是慢病的 统计高血压的 糖尿病  1高血压,2糖尿病  糖尿病和高血压是100
                //如果是慢病的 统计高血压的 糖尿病  1高血压,2糖尿病  3 糖尿病和高血压 4健康人群数
                String diseaseType="";
                String jsonString = redisTemplate.opsForValue().get("disease:" + signFamily.getPatient());
                if (StringUtils.isEmpty(jsonString)) {
                    continue;
                }
                //排除数据 只留下高血压和糖尿病
                List<JSONObject> jsonObjects = new ArrayList<JSONObject>();
                JSONArray redisValues = new JSONArray(jsonString);
                for (Object obj : redisValues) {
                    JSONObject redisValue = new JSONObject(obj);
                    //排除掉三师签约
                    if ("1".equals(redisValue.get("signType").toString())) {
                        continue;
                    }
                    String disease = redisValue.get("disease").toString();
                    if (Integer.valueOf(disease).equals("1")) {
                        jsonObjects.add(redisValue);
                        hasGXY = true;//设置有高血压
                        diseaseType="1";
                    }
                    if (Integer.valueOf(disease).equals("2")) {
                        jsonObjects.add(redisValue);
                        hasTNB = true;//设置有糖尿病
                        diseaseType="2";
                    diseaseType="4";//健康人群
                }else{
                    //排除数据 只留下高血压和糖尿病
                    List<JSONObject> jsonObjects = new ArrayList<JSONObject>();
                    JSONArray redisValues = new JSONArray(jsonString);
                    if(redisValues.length()>0){
                        for (Object obj : redisValues) {
                            JSONObject redisValue = new JSONObject(obj);
                            //排除掉三师签约
                            if ("1".equals(redisValue.get("signType").toString())) {
                                continue;
                            }
                            String disease = redisValue.get("disease").toString();
                            if (Integer.valueOf(disease).equals("1")) {
                                jsonObjects.add(redisValue);
                                hasGXY = true;//设置有高血压
                                diseaseType="1";
                            }
                            if (Integer.valueOf(disease).equals("2")) {
                                jsonObjects.add(redisValue);
                                hasTNB = true;//设置有糖尿病
                                diseaseType="2";
                            }
                        }
                        if(hasGXY&&hasTNB){
                            diseaseType="3";
                        }
                    }else{
                        diseaseType="4";
                    }
                }
                if(hasGXY&&hasTNB){
                    diseaseType="100";
                }
                //统计市
                compute(cityAgeMap, Constant.city, ageCode, diseaseType);
                //统计区

+ 9 - 1
src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java

@ -12,12 +12,20 @@ public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, J
	
	Consult findByCode(String code);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
	Page<Object> findByPatient(String patient,String title, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
	Page<Object> findByPatient(String patient,String title, long id, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
	Page<Object> findByPatient(String patient, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1' order by a.czrq desc")
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
	Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
	@Query("select count(a) from Consult a,ConsultTeamDoctor b  where a.code = b.consult and a.patient=?1 and b.to=?2 ")

+ 25 - 0
src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -6,6 +6,7 @@
package com.yihu.wlyy.repository.consult;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
@ -144,4 +145,28 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	//查找
	@Query("SELECT a FROM ConsultTeam a WHERE a.patient=?1 and a.status=0 and a.del=1")
	ConsultTeam findFamousConsultByPatient(String uid);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, long id, Pageable pageRequest);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, Pageable pageRequest);
	//名医咨询 -全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, long id,String title, Pageable pageRequest);
	//名医咨询 -全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorAllList(String uid,String title, Pageable pageRequest);
	//名医咨询 -根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.status = ?3 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid, long id,Integer type, Pageable pageRequest);
	//名医咨询 -根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.status = ?2  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid,Integer type, Pageable pageRequest);
	//名医咨询 -根据status 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = ?4 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid, long id,String title,Integer type, Pageable pageRequest);
	//名医咨询 -根据status 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2 and a.status = ?3 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid,String title,Integer type, Pageable pageRequest);
}

+ 15 - 5
src/main/java/com/yihu/wlyy/service/app/consult/ConsultService.java

@ -19,6 +19,7 @@ import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.util.StringUtils;
public class ConsultService extends BaseService {
@ -68,7 +69,7 @@ public class ConsultService extends BaseService {
	 * @param pagesize 分页大小
	 * @return
	 */
	public Page<Object> findConsultRecordByPatient(String patient, long id, int pagesize) {
	public Page<Object> findConsultRecordByPatient(String patient, long id, int pagesize,String title) {
		if (id < 0) {
			id = 0;
		}
@ -79,10 +80,19 @@ public class ConsultService extends BaseService {
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		if (id > 0) {
			return consultDao.findByPatient(patient, id, pageRequest);
		} else {
			return consultDao.findByPatient(patient, pageRequest);
		if(!StringUtils.isEmpty(title)){
			title="%"+title+"%";
			if (id > 0) {
				return consultDao.findByPatient(patient,title, id, pageRequest);
			} else {
				return consultDao.findByPatient(patient,title, pageRequest);
			}
		}else{
			if (id > 0) {
				return consultDao.findByPatient(patient, id, pageRequest);
			} else {
				return consultDao.findByPatient(patient, pageRequest);
			}
		}
	}

+ 59 - 13
src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -83,12 +83,12 @@ public class ConsultTeamService extends ConsultService {
	/**
	 * 查詢醫生網絡諮詢列表
	 * @param type 咨询类型:1、咨询我的,2、公共的, 3、参与过的,4、已结束的
	 * @param type 咨询类型:1、咨询我的,2、公共的, 3、参与过的,4、已结束的 5 名医咨询 全部  6 名医咨询 进行中 7 名医咨询 已结束
	 * @param id
	 * @param pagesize 每页显示数,默认为10
	 * @return
	 */
	public Page<ConsultTeam> findByDoctor(String uid, int type, long id, int pagesize) {
	public Page<ConsultTeam> findByDoctor(String uid, int type, long id, int pagesize,String title) {
		if (id < 0) {
			id = 0;
		}
@ -112,12 +112,58 @@ public class ConsultTeamService extends ConsultService {
			// 已完成的
			return findByDoctorType4(uid, id, pagesize);
		case 5:
			// 名医咨询
			return findByDoctorType1(uid, type, id, pagesize);
			// 5 名医咨询 全部
			return findByDoctorType5(uid, id, pagesize,title);
		case 6:
			//6 名医咨询 进行中
			return findByDoctorType6(uid, 0, id, pagesize,title);
		case 7:
			//7 名医咨询 已结束
			return findByDoctorType6(uid, 1, id, pagesize,title);
		}
		return null;
	}
	private Page<ConsultTeam> findByDoctorType5(String uid,  long id, int pagesize,String title) {
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		if(StringUtils.isNoneEmpty(title)){
			title="%"+title+"%";
			if (id > 0) {
				return consultTeamDao.findFamousDoctorAllList(uid, id,title, pageRequest);
			} else {
				return consultTeamDao.findFamousDoctorAllList(uid,title, pageRequest);
			}
		}else{
			if (id > 0) {
				return consultTeamDao.findFamousDoctorAllList(uid, id, pageRequest);
			} else {
				return consultTeamDao.findFamousDoctorAllList(uid, pageRequest);
			}
		}
	}
	private Page<ConsultTeam> findByDoctorType6(String uid, int type, long id, int pagesize,String title) {
		// 排序
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		if(StringUtils.isNoneEmpty(title)){
			title="%"+title+"%";
			if (id > 0) {
				return consultTeamDao.findFamousDoctorDoingList(uid, id,title,type, pageRequest);
			} else {
				return consultTeamDao.findFamousDoctorDoingList(uid, title,type,pageRequest);
			}
		}else{
			if (id > 0) {
				return consultTeamDao.findFamousDoctorDoingList(uid, id,type, pageRequest);
			} else {
				return consultTeamDao.findFamousDoctorDoingList(uid,type, pageRequest);
			}
		}
	}
	/**
	 * 查询全部咨询记录
	 * @param uid
@ -662,6 +708,15 @@ public class ConsultTeamService extends ConsultService {
		return consultTeamLogDao.findOne(logId);
	}
	public boolean isExistFamousConsult(String uid) {
		ConsultTeam consultTeam= consultTeamDao.findFamousConsultByPatient(uid);
		if(consultTeam!=null){
			return true;
		}else{
			return false;
		}
	}
	public void addFamousTeamConsult(ConsultTeam ct, String uid) throws Exception{
		// 设置患者信息
		ct.setPatient(uid);
@ -701,13 +756,4 @@ public class ConsultTeamService extends ConsultService {
		// 添加医生咨询日志
		addLogs(ct);
	}
	public boolean isExistFamousConsult(String uid) {
		ConsultTeam consultTeam= consultTeamDao.findFamousConsultByPatient(uid);
		if(consultTeam!=null){
			return true;
		}else{
			return false;
		}
	}
}

+ 3 - 0
src/main/java/com/yihu/wlyy/service/app/family/FamilyService.java

@ -212,6 +212,9 @@ public class FamilyService {
                    patientTemp.setPoints(0);
                    patientTemp.setRecordAmount(0);
                    patientDao.save(patientTemp);
                    jo.put("code",patientTemp.getCode());
                }else{
                    jo.put("code",patient.getCode());
                }
            }
        }

+ 37 - 0
src/main/java/com/yihu/wlyy/service/common/account/DoctorService.java

@ -5,10 +5,17 @@
 *******************************************************************************/
package com.yihu.wlyy.service.common.account;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.persistence.DynamicSpecifications;
import org.springside.modules.persistence.SearchFilter;
import org.springside.modules.utils.Clock;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
@ -16,6 +23,10 @@ import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.util.EncodesUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 医生基本信息类.
 *
@ -66,5 +77,31 @@ public class DoctorService extends TokenService {
	}
	public Page<Doctor> famousDoctorList(String name, long id, int pagesize) {
		if (pagesize <= 0) {
			pagesize = 10;
		}
		// 排序
		Sort sort = new Sort(Sort.Direction.ASC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		// 设置查询条件
		Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
		if (StringUtils.isNoneEmpty(name)) {
			filters.put("name", new SearchFilter("name", SearchFilter.Operator.LIKE, "%"+name+"%"));
		}
		if (id > 0) {
			filters.put("id", new SearchFilter("id", SearchFilter.Operator.GT, id));
		}
		//设置过滤条件是名医
		//filters.put("level", new SearchFilter("level", SearchFilter.Operator.EQ, level));
		//设置过滤条件是次数大于零
		//filters.put("level", new SearchFilter("level", SearchFilter.Operator.EQ, level));
		// 未作废
		filters.put("status", new SearchFilter("status", SearchFilter.Operator.EQ, 1));
		Specification<Doctor> spec = DynamicSpecifications.bySearchFilter(filters.values(), Doctor.class);
		return doctorDao.findAll(spec, pageRequest);
	}
}

+ 2 - 2
src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -53,9 +53,9 @@ public class DoctorConsultController extends WeixinBaseController {
	 */
	@RequestMapping(value = "list")
	@ResponseBody
	public String list(int type, int id, int pagesize, @RequestParam(required = false) String patient) {
	public String list(int type, int id, int pagesize, @RequestParam(required = false) String patient, @RequestParam(required = false) String title) {
		try {
			Page<ConsultTeam> list = consultTeamService.findByDoctor(getUID(), type, id, pagesize);
			Page<ConsultTeam> list = consultTeamService.findByDoctor(getUID(), type, id, pagesize,title);
			JSONArray jsonArray = new JSONArray();
			for (ConsultTeam consult : list) {
				if (consult == null) {

+ 124 - 7
src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -54,16 +54,20 @@ public class ConsultController extends WeixinBaseController {
	/**
	 * 患者咨询记录查询
	 * @param title 咨询标题
	 * @param id
	 * @param pagesize 分页大小
	 * @return
	 */
	@RequestMapping(value = "records")
	@ResponseBody
	public String consultRecords(long id, int pagesize) {
	public String consultRecords(
			@RequestParam(required = false) String  title,
			long id,
			int pagesize) {
		try {
			JSONArray array = new JSONArray();
			Page<Object> data = consultTeamService.findConsultRecordByPatient(getUID(), id, pagesize);
			Page<Object> data = consultTeamService.findConsultRecordByPatient(getUID(), id, pagesize,title);
			if (data != null) {
				for (Object consult : data.getContent()) {
					if (consult == null) {
@ -228,7 +232,7 @@ public class ConsultController extends WeixinBaseController {
				voice = CommonUtil.copyTempVoice(voice);
			}
			ConsultTeam consult = new ConsultTeam();
			// 设置咨询类型:1三师咨询,2家庭医生咨询
			// 设置咨询类型:1三师咨询,2家庭医生咨询  6.名医咨询
			consult.setType(type);
			// 设置发病时间
			consult.setWhen(when);
@ -256,7 +260,12 @@ public class ConsultController extends WeixinBaseController {
				DoctorStatisticsTask.getInstance(doctorStatisticsService).put(consult.getDoctor(), 1, 1, 0);
			}
			// 推送消息给医生
			PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.指定咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.您有新的指定咨询.name(), consult.getConsult());
			if(type==6){
				// 推送消息给医生
				PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.您有新的名医咨询.name(), consult.getConsult());
			}else{
				PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.指定咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.您有新的指定咨询.name(), consult.getConsult());
			}
			return success("提交成功");
		} catch (Exception ex) {
			error(ex);
@ -282,6 +291,16 @@ public class ConsultController extends WeixinBaseController {
					  @RequestParam(required = false) String images,
					  @RequestParam(required = false) String voice) {
		try {
			//判断医生是否是在工作时间
			JSONObject jo=doctorWorkTimeService.isDoctorWorking(doctorCode);
			if(!jo.get("status").equals("1")){
				return error(-1, jo.get("msg").toString());
			}
			//判断医生是否剩下咨询次数
			int result = doctorWorkTimeService.getDoctorConsultTimesRemain(doctorCode);
			if(result==0){
				return error(-1, "没有次数");
			}
			if (StringUtils.isEmpty(images)) {
				images = fetchWxImages();
			}
@ -300,8 +319,8 @@ public class ConsultController extends WeixinBaseController {
				return error(-1, "已经存在名医咨询!");
			}
			ConsultTeam consult = new ConsultTeam();
			// 设置咨询类型:1三师咨询,2家庭医生咨询 3.名医咨询
			consult.setType(3);
			// 设置咨询类型:1三师咨询,2家庭医生咨询 6.名医咨询
			consult.setType(6);
			// 设置发病时间
			consult.setWhen(when);
			// 设置主要症状
@ -313,7 +332,8 @@ public class ConsultController extends WeixinBaseController {
			consult.setDoctor(doctorCode);//设置专科医生
			// 保存到数据库
			consultTeamService.addFamousTeamConsult(consult, getUID());
			//名医咨询次数减一
			doctorWorkTimeService.setDoctorCurrentConsultTimesRemain(doctorCode);
			// 推送消息给医生
			PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.您有新的名医咨询.name(), consult.getConsult());
			return success("提交成功");
@ -323,7 +343,104 @@ public class ConsultController extends WeixinBaseController {
		}
	}
	/**
	 * 名医列表
	 * @return
     */
	@RequestMapping(value = "famousDoctorList")
	@ResponseBody
	public String famousDoctorList(
									@RequestParam(required = false) String name,
									long id,
									int pagesize) {
		try {
			JSONArray array = new JSONArray();
			Page<Doctor>list = doctorService.famousDoctorList(name, id, pagesize);
			if (list != null) {
				for (Doctor doctor : list) {
					if (doctor == null) {
						continue;
					}
					JSONObject json = new JSONObject();
					json.put("id", doctor.getId());
					// 医生标识
					json.put("code", doctor.getCode());
					// 医生姓名
					json.put("name", doctor.getName());
					// 所在医院名称
					json.put("hospital", doctor.getHospital());
					// 所在医院名称
					json.put("hospital_name", doctor.getHosptialName());
					// 科室名称
					json.put("dept_name", (doctor.getDeptName() == null ||
							StringUtils.isEmpty(doctor.getDeptName().toString())) ? " " : doctor.getDeptName());
					// 职称名称
					json.put("job_name", (doctor.getJobName() == null ||
							StringUtils.isEmpty(doctor.getJobName().toString())) ? " " : doctor.getJobName());
					// 头像
					json.put("photo", doctor.getPhoto());
					// 简介
					json.put("introduce", doctor.getIntroduce());
					// 专长
					json.put("expertise", doctor.getExpertise());
					// 剩余咨询次数
					json.put("num", doctorWorkTimeService.getDoctorConsultTimesRemain(doctor.getCode()));
					array.put(json);
				}
			}
			return write(200, "获取医院医生列表成功!", "list", array);
		} catch (Exception e) {
			error(e);
			return error(-1, "获取医院医生列表失败!");
		}
	}
	/**
	 * 名医主页
	 * @return
	 */
	@RequestMapping(value = "famousDoctorPage")
	@ResponseBody
	public String famousDoctorPage(
			 String doctorCode) {
		try {
			Doctor temp = doctorService.findDoctorByCode(doctorCode);
			if (temp != null) {
				JSONObject json = new JSONObject();
				// 设置医生手机号码
				json.put("mobile", temp.getMobile());
				// 设置医生标识
				json.put("code", temp.getCode());
				// 设置医生姓名
				json.put("name", temp.getName());
				// 设置医生头像
				json.put("photo", CommonUtil.getPhoneUrl(temp.getPhoto()));
				// 设置医生性别
				json.put("sex", temp.getSex());
				// 设置省名称
				json.put("provinceName", temp.getProvinceName());
				// 设置城市名称
				json.put("cityName", temp.getCityName());
				// 设置医院名称
				json.put("hospitalName", temp.getHosptialName());
				// 设置部门名称
				json.put("deptName", StringUtils.isNotEmpty(temp.getDeptName()) ? temp.getDeptName() : "");
				// 设置职称
				json.put("jobName", StringUtils.isNotEmpty(temp.getJobName()) ? temp.getJobName() : "");
				// 设置医生专长
				json.put("expertise", StringUtils.isNotEmpty(temp.getExpertise()) ? temp.getExpertise() : "");
				// 设置医生简介
				json.put("introduce", StringUtils.isNotEmpty(temp.getIntroduce()) ? temp.getIntroduce() : "");
				//doctorWorkTimeService.findDoctorWeekWorkTime()
				return write(200, "医生信息查询成功!", "data", json);
			} else {
				return error(-1, "医生信息查询失败!");
			}
		} catch (Exception e) {
			error(e);
			return invalidUserException(e, -1, "医生信息查询失败!");
		}
	}
	@RequestMapping(value = "status")
	@ResponseBody