huangwenjie пре 5 година
родитељ
комит
1ebfc40c5b

+ 37 - 5
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -243,7 +243,7 @@ public class ImService {
	}
	
	/**
	 * 查询居民与某个医生未结束的咨询
	 * 查询居民与某个医生未结束的专家咨询
	 *
	 * @param patient 居民
	 * @param doctor  医生
@ -257,7 +257,34 @@ public class ImService {
				"AND a.patient= '" +patient+"' "+
				"AND b.to_doctor='" +doctor+"' "+
				"AND a.del='1' " +
				"AND a.type<> 9 " +
				"AND (a.type<> 9 or a.type<> 16)" +
				"AND a.`status`=0";
		
		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
		
		String consultCode = "";
		if (rstotal != null && rstotal.size() > 0) {
			consultCode = rstotal.get(0).get("consultCode").toString();
		}
		return consultCode;
	}
	
	/**
	 * 查询全科医生与某个医生未结束的专家咨询
	 *
	 * @param patient 居民
	 * @param doctor  医生
	 * @return
	 */
	public String  getUnfinishedConsultByActualSender(String actualSender, String doctor) {
		
		String totalSql = "SELECT a.consult as consultCode " +
				"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
				"WHERE a.consult=b.consult " +
				"AND b.to_doctor='" +doctor+"' "+
				"AND b.actual_sender='" +actualSender+"' "+
				"AND a.del='1' " +
				"AND a.type<> 12 " +
				"AND a.`status`=0";
		
		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
@ -1286,8 +1313,13 @@ public class ImService {
	 * @return
	 */
	public JSONObject getConsultInfoAndPatientInfo(String consult,String patientCode) {
		BasePatientDO basePatientDO = basePatientDao.findById(patientCode);
		ConsultDo consultDo = consultDao.findOne(consult);
		BasePatientDO basePatientDO = null;
		if(StringUtils.isEmpty(patientCode)){
			patientCode = consultDo.getPatient();
		}
		basePatientDO = basePatientDao.findById(patientCode);
		
		JSONObject result = new JSONObject();
		
		JSONObject patientinfoObj = new JSONObject();
@ -1888,7 +1920,7 @@ public class ImService {
				"d.photo AS patientphoto " +
				"FROM wlyy_consult a," +
				"wlyy_consult_team b," +
				"base_patient d, " +
				"base_patient d " +
				"WHERE a.id=b.consult " +
				"AND b.patient=d.id AND b.patient='"+patinet+"' "+
				"AND b.actual_sender='"+doctor+"' ";
@ -1954,7 +1986,7 @@ public class ImService {
				" COUNT(1) AS total " +
				"FROM wlyy_consult a," +
				"wlyy_consult_team b," +
				"base_patient d," +
				"base_patient d " +
				"WHERE a.id=b.consult " +
				"AND b.patient=d.id AND b.patient='"+patient+"' "+
				"AND b.actual_sender='"+doctor+"' ";

+ 1 - 1
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -394,7 +394,7 @@ public class BaseHospitalRequestMapping {
        public static final String isExistsUnfinishedConsult ="/isExistsUnfinishedConsult";
        
        //(健康咨询)医生咨询记录查询
        public static final String expertConsultRecords ="/records";
        public static final String expertConsultRecords ="/expertConsultRecords";
        
        //医生可接单列表(图文复诊、视频复诊、协同门诊)
        public static final String findWaitingRoomOutpatientByDoctor = "findWaitingRoomOutpatientByDoctor";

+ 6 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -522,9 +522,12 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	                                          @ApiParam(name = "special_doctor", value = "专科医生")
	                                          @RequestParam(value = "special_doctor", required = true)String special_doctor
	                                          ) throws Exception {
		String session_id = patient_code+"_"+general_doctor+"_"+special_doctor+"_15";
		session_id = imService.isExistsUnfinishedConsult(session_id);
		return success(session_id);
		if(org.apache.axis.utils.StringUtils.isEmpty(patient_code)){
			patient_code= getUID();
		}
		
		String consultCode = imService.getUnfinishedConsultByActualSender(general_doctor, special_doctor);
		return success("请求成功",consultCode);
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.expertConsultRecords)

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -113,7 +113,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.isExistsUnfinishedConsult)
	@ApiOperation(value = "查询居民与某个医生是否存在未结束的咨询")
	@ApiOperation(value = "查询居民与某个医生是否存在未结束的专家咨询")
	public Envelop isExistsUnfinishedConsult(
			@ApiParam(name = "doctor", value = "医生CODE")
			@RequestParam(value = "doctor",required = true) String doctor,