Przeglądaj źródła

修改判断居民专家咨询的接口BUG

huangwenjie 5 lat temu
rodzic
commit
05a799e2a7

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

@ -164,9 +164,9 @@ public class ImService {
	 * @param doctor  医生
	 * @param doctor  医生
	 * @return
	 * @return
	 */
	 */
	public Long  getUnfinishedConsult(String patient, String doctor) {
	public String  getUnfinishedConsult(String patient, String doctor) {
		
		
		String totalSql = "SELECT count(a.id) AS total " +
		String totalSql = "SELECT a.consult as consultCode " +
				"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
				"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
				"WHERE a.consult=b.consult " +
				"WHERE a.consult=b.consult " +
				"AND a.patient= '" +patient+"' "+
				"AND a.patient= '" +patient+"' "+
@ -177,11 +177,11 @@ public class ImService {
		
		
		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
		
		
		Long count = 0L;
		String consultCode = "";
		if (rstotal != null && rstotal.size() > 0) {
		if (rstotal != null && rstotal.size() > 0) {
			count = (Long) rstotal.get(0).get("total");
			consultCode = rstotal.get(0).get("consultCode").toString();
		}
		}
		return count;
		return consultCode;
	}
	}
	
	
	
	
@ -620,7 +620,7 @@ public class ImService {
	 */
	 */
	public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor) throws Exception {
	public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor) throws Exception {
		JSONObject re = new JSONObject();
		JSONObject re = new JSONObject();
		if (getUnfinishedConsult(patient, doctor) > 0) {//判断是否有未结束的咨询移到同步方法中
		if (!StringUtils.isEmpty(getUnfinishedConsult(patient, doctor))) {//判断是否有未结束的咨询移到同步方法中
//			re.put("status", -3);
//			re.put("status", -3);
//			return re;
//			return re;
			throw new RuntimeException("居民还有未结束的专家咨询!");
			throw new RuntimeException("居民还有未结束的专家咨询!");

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

@ -95,14 +95,14 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "doctor", value = "医生CODE")
			@ApiParam(name = "doctor", value = "医生CODE")
			@RequestParam(value = "doctor",required = true) String doctor,
			@RequestParam(value = "doctor",required = true) String doctor,
			@ApiParam(name = "patient", value = "居民CODE")
			@ApiParam(name = "patient", value = "居民CODE")
			@RequestParam(value = "patient",required = false) String patient)throws Exception {
			@RequestParam(value = "patient",required = true) String patient)throws Exception {
		
		
		if(StringUtils.isEmpty(patient)){
		if(StringUtils.isEmpty(patient)){
			patient= getUID();
			patient= getUID();
		}
		}
		
		
		Long count = imService.getUnfinishedConsult(getUID(), doctor);
		return success(count);
		String consultCode = imService.getUnfinishedConsult(patient, doctor);
		return success("请求成功",consultCode);
	}
	}
	
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.participants)
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.participants)