Browse Source

三院知识库后台配置接口开发完成

wangzhinan 2 years ago
parent
commit
d353964f03

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

@ -3179,6 +3179,7 @@ public class ImService {
     * @return
     */
    public String patientGuaidenceAppend(String sender_id, String sender_name, String session_id, String content_type, String content, String business_type, String extend) throws Exception {
        logger.info("导诊推送im="+content);
        return imUtil.sendImMsg(sender_id, sender_name, session_id, content_type, content, "1", extend);
    }

+ 11 - 9
business/im-service/src/main/java/com/yihu/jw/im/service/RobotService.java

@ -197,7 +197,8 @@ public class RobotService {
     */
    public void replyGuaidenceContent(String sessionId,String type,String content,String contentType,String businessType, String extend){
        try {
            BaseSystemDialogSetting setting = dialogSettingDao.findBySystemTypeAndFunctionType(sessionTypeToType(type),"7",1);
            String systemType = sessionTypeToType(type);
            BaseSystemDialogSetting setting = dialogSettingDao.findBySystemTypeAndFunctionType(systemType,"7",1);
            if(setting==null){
                return;
            }
@ -230,6 +231,7 @@ public class RobotService {
                                contentTypes = ImUtil.ContentType.KnowCommonQuestions+"";
                                contentMsg = selectByContentType(contentTypes,flowConfigurationRelation.getRelationCode()).toJSONString();
                            }
                            imService.patientGuaidenceAppend(dictDO.getDictCode(),dictDO.getDictValue(),sessionId,
                                    contentTypes+"", contentMsg, "1",null);
                        }
@ -380,7 +382,7 @@ public class RobotService {
    //查找常见问题
    public BaseKnowledgeQuestion findQuestionLikeName(String content){
        if(StringUtils.isNotEmpty(content)){
        if(!StringUtils.isNotEmpty(content)){
            return null;
        }
        String sql = "select p.* from base_knowledge_question p where p.status = 1 and p.del=1 and  " +
@ -395,7 +397,7 @@ public class RobotService {
    //查找常见问题关联配置
    public List<BaseKnowledgeFlowConfigurationRelation> findFlowConfigurationRelationLikeName(String content){
        if(StringUtils.isNotEmpty(content)){
        if(!StringUtils.isNotEmpty(content)){
            return null;
        }
        String sql = "select p.* from base_knowledge_flow_configuration_relation p where " +
@ -436,20 +438,20 @@ public class RobotService {
     * @return
     */
    //会话类型转类型
    private String sessionTypeToType(String type){
        if(StringUtils.isNotEmpty(type)){
    public String sessionTypeToType(String type){
        if(!StringUtils.isNotEmpty(type)){
            return type;
        }
        if("18".equals(type)){
        if("18".equalsIgnoreCase(type)){
            return "1";
        }
        if("26".equals(type)){
        if("26".equalsIgnoreCase(type)){
            return "2";
        }
        if("27".equals(type)){
        if("27".equalsIgnoreCase(type)){
            return "3";
        }
        if("1".equals(type)||"5".equals(type)||"9".equals(type)||"12".equals(type)||"15".equals(type)||"16".equals(type)){
        if("1".equalsIgnoreCase(type)||"5".equalsIgnoreCase(type)||"9".equalsIgnoreCase(type)||"12".equalsIgnoreCase(type)||"15".equalsIgnoreCase(type)||"16".equalsIgnoreCase(type)){
            return "4";
        }
        return type;

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

@ -903,7 +903,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		try {
			String session_id = patientCode+type;
			session_id = imService.getPatientGuaidenceConsult(patientCode,session_id,null);
			session_id = imService.getPatientGuaidenceConsult(patientCode,session_id,type);
			return success(session_id);
		}catch (Exception e){
			return failedException(e);
@ -1025,7 +1025,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			String result = imService.patientGuaidenceAppend(sender_id,sender_name,session_id,content_type,content,"1",extend);
			robotService.sendReplyMap(map);
			//消息存在时文本及问题集类型发送时自动回复
			robotService.replyGuaidenceContent(sender_id,type,content,content_type,"1",extend);
			robotService.replyGuaidenceContent(session_id,type,content,content_type,"1",extend);
			List<BaseDoctorRoleDO> doctorRoleDOS = doctorRoleDao.findByRoleCode("guidance");
			for (BaseDoctorRoleDO doctorRoleDO:doctorRoleDOS){
				System.out.println("发送外层SOCKET消息:通知医生导诊");

+ 2 - 2
svr/svr-internet-hospital/src/main/resources/application.yml

@ -1440,8 +1440,8 @@ hospital:
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
  im_list_get: http://172.26.0.153:3000/
  data_base_name: im
es:
  pwflag: 1 # 1需要密码,2不需要密码