huangwenjie 5 år sedan
förälder
incheckning
3ef1f3ad51

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

@ -1690,6 +1690,26 @@ public class ImService {
		}
	}
	
	/**
	 * 发送咨询建议
	 * @param jsonObject
	 * @param doctor
	 * @param doctorName
	 * @param outpatientId
	 * @param patient
	 * @return
	 * @throws Exception
	 */
	public String sendOutPatientSuggestMsg(com.alibaba.fastjson.JSONObject jsonObject,String doctor,String doctorName,String outpatientId,String patient,String outpatientType) throws Exception {
		if("1".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "34",jsonObject.toString(),"1");
		}else if("2".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "34",jsonObject.toString(),"1");
		}else{
			return null;
		}
	}
	
	
	/**
	 * 发送处方驳回消息

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

@ -920,6 +920,9 @@ public class BaseHospitalRequestMapping {
    
        //医生端:发起/断开 会话小程序视频邀请
        public static final String videoInviteMiniProgram="videoInviteMiniProgram";
    
        //医生端:发送会诊建议消息
        public static final String sendOutPatientSuggestMsg = "sendOutPatientSuggestMsg";
    }

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

@ -10,6 +10,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
@ -716,5 +717,38 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		wxTemplateService.sendWeTempMesMiniProgram(sender_id,sender_name,reciver_id,reciver_name,session_id);
		return success("操作成功");
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.sendOutPatientSuggestMsg)
	@ApiOperation(value = "医生端:发送咨询建议消息", notes = "医生端:发送咨询建议消息")
	public Envelop sendOutPatientSuggestMsg(@ApiParam(name = "outPatientId", value = "门诊编号")
	                                            @RequestParam(value = "outPatientId", required = true)String outPatientId,
	                                        @ApiParam(name = "diagnosticAdvice", value = "诊断建议")
	                                            @RequestParam(value = "diagnosticAdvice", required = true)String diagnosticAdvice,
	                                        @ApiParam(name = "treatmentAdvice", value = "治疗建议")
	                                            @RequestParam(value = "treatmentAdvice", required = true)String treatmentAdvice,
	                                        @ApiParam(name = "adjust", value = "0调整 1已调整,非必填,默认为0")
	                                            @RequestParam(value = "treatmentAdvice", required = false)String adjust
	)throws Exception  {
		try {
			com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outPatientId);
			
			if(StringUtils.isBlank(adjust)){
				adjust = "0";
			}
			
			msgObj.put("adjust",adjust);//0调整 1已调整,非必填,默认为0
			msgObj.put("diagnosticAdvice",diagnosticAdvice);//诊断建议
			msgObj.put("treatmentAdvice",treatmentAdvice);//治疗建议
			msgObj.put("outPatientId",outPatientId);
			
			String immsg = imService.sendOutPatientSuggestMsg(msgObj,wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getDoctorName(),outPatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
			System.out.println("发送咨询建议消息成功:"+immsg);
		}catch (Exception e){
			System.out.println("发送咨询建议消息失败:"+e.getMessage());
//            e.printStackTrace();
		}
		return success("操作成功");
	}
}