Quellcode durchsuchen

医生发送取消IM消息

huangwenjie vor 4 Jahren
Ursprung
Commit
1f10e73444

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

@ -2690,4 +2690,22 @@ public class ImService {
		List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
		return list;
	}
	
	/**
	 * 发送医生取消IM消息
	 * @param patientName
	 * @param doctor
	 * @param doctorName
	 * @param session_id
	 * @param cancleReason
	 * @param cancleContent
	 * @return
	 */
	public String sendOutPatientCancle(String patientName, String doctor, String doctorName, String session_id, String cancleReason, String cancleContent) {
		JSONObject msg = new JSONObject();
		msg.put("content",patientName+",您好!您的复诊已被医生取消");
		msg.put("cancleReason",cancleReason);
		msg.put("cancleContent",cancleContent);
		return imUtil.sendImMsg(doctor, doctorName, session_id, "35",msg.toString(),"1");
	}
}

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

@ -986,6 +986,9 @@ public class BaseHospitalRequestMapping {
        
        //医生端:获取咨询建议
        public static final String getConsultSuggest = "getConsultSuggest";
    
        //医生端:发送医生取消IM消息
        public static final String sendOutPatientCancle = "sendOutPatientCancle";
    }

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

@ -751,5 +751,31 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	)throws Exception  {
		return success("操作成功",prescriptionService.getConsultSuggest(consultcode));
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.sendOutPatientCancle)
	@ApiOperation(value = "医生端:发送医生取消IM消息", notes = "医生端:发送医生取消IM消息")
	public Envelop sendOutPatientCancle(@ApiParam(name = "patientName", value = "patientName")
	                                     @RequestParam(value = "patientName", required = true)String patientName,
	                                     @ApiParam(name = "session_id", value = "咨询sessionid")
	                                     @RequestParam(value = "session_id", required = true)String session_id,
	                                     @ApiParam(name = "doctor", value = "医生CODE")
	                                     @RequestParam(value = "doctor", required = true)String doctor,
	                                     @ApiParam(name = "doctorName", value = "")
	                                     @RequestParam(value = "doctorName", required = true)String doctorName,
	                                    @ApiParam(name = "cancleReason", value = "取消原因")
	                                        @RequestParam(value = "cancleReason", required = true)String cancleReason,
	                                    @ApiParam(name = "cancleContent", value = "取消说明")
	                                        @RequestParam(value = "cancleContent", required = true)String cancleContent
	
	)throws Exception  {
		try {
			String immsg = imService.sendOutPatientCancle(patientName,doctor,doctorName,session_id,cancleReason,cancleContent);
			System.out.println("发送医生取消IM消息成功:"+immsg);
		}catch (Exception e){
			System.out.println("发送医生取消IM消息失败:"+e.getMessage());
//            e.printStackTrace();
		}
		return success("操作成功");
	}
}