Browse Source

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

wangzhinan 2 years ago
parent
commit
aa80088648

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/knowledge/service/BaseKnowledgeQuestionService.java

@ -129,7 +129,7 @@ public class BaseKnowledgeQuestionService extends BaseJpaService<BaseKnowledgeQu
        }
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql+condition+orderBy, page, size);
        String sqlCount ="select COUNT(1) as total from base_knowledge_question where 1=1 ";
        List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(sqlCount+condition);
        List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(sqlCount+condition+orderBy);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = Long.parseLong(rstotal.get(0).get("total").toString());
@ -295,7 +295,7 @@ public class BaseKnowledgeQuestionService extends BaseJpaService<BaseKnowledgeQu
            map.put("questionsRelation",questionsRelations);
        }
        String sqlCount ="select COUNT(1) as total from base_knowledge_questions where 1=1 ";
        List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(sqlCount+condition);
        List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(sqlCount+condition+orderBy);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = Long.parseLong(rstotal.get(0).get("total").toString());

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

@ -642,7 +642,7 @@ public class ImService {
                failed.add(String.valueOf(resObj.get("data")));
            }
        }
        if(type==1||type==3002){
        if(type==1||type==3001){
            robotService.replyContent(consultModel.getType()+"",content,consult,type);
        }

+ 14 - 4
business/im-service/src/main/java/com/yihu/jw/im/service/RobotService.java

@ -143,6 +143,12 @@ public class RobotService {
    //普通咨询常见问题匹配
    public void replyContent(String type,String content,String consult,Integer contentType){
        try {
            WlyyHospitalSysDictDO dictDO = getSender();
            if (contentType==3003){
                String contentTypes = ImUtil.ContentType.KnowCommonDict+"";
                String contentMsg = selectByContentType(contentTypes,content).toJSONString();
                imUtil.sendTopicIM(dictDO.getDictCode(), dictDO.getDictName(), consult, contentTypes, contentMsg,null);
            }
            BaseSystemDialogSetting setting = dialogSettingDao.findBySystemTypeAndFunctionType(sessionTypeToType(type),"7",1);
            if(setting==null){
                return;
@ -157,7 +163,6 @@ public class RobotService {
            if(question!=null){
                //匹配到相关问题后先推送答案
                String answer = question.getAnswer();
                WlyyHospitalSysDictDO dictDO = getSender();
                imUtil.sendTopicIM(dictDO.getDictCode(), dictDO.getDictName(), consult, "1", answer,null);
                //匹配问题是否关联其他配置;
                if (question.getFlag()==null){
@ -185,8 +190,6 @@ public class RobotService {
    /**
     *
     * @param senderId 发送人id
     * @param senderName 发送人名称
     * @param sessionId 会话id
     * @param type 咨询类型
     * @param content 内容
@ -197,6 +200,13 @@ public class RobotService {
     */
    public void replyGuaidenceContent(String sessionId,String type,String content,String contentType,String businessType, String extend){
        try {
            WlyyHospitalSysDictDO dictDO = getSender();
            if (contentType.equalsIgnoreCase("3003")){
                String contentTypes = ImUtil.ContentType.KnowCommonDict+"";
                String contentMsg = selectByContentType(contentTypes,content).toJSONString();
                imService.patientGuaidenceAppend(dictDO.getDictCode(),dictDO.getDictValue(),sessionId,
                        contentTypes+"", contentMsg, "1",null);
            }
            String systemType = sessionTypeToType(type);
            BaseSystemDialogSetting setting = dialogSettingDao.findBySystemTypeAndFunctionType(systemType,"7",1);
            if(setting==null){
@ -214,7 +224,7 @@ public class RobotService {
                if(question!=null){
                    //匹配到相关问题后先推送答案
                    String answer = question.getAnswer();
                    WlyyHospitalSysDictDO dictDO = getSender();
                    imService.patientGuaidenceAppend(dictDO.getDictCode(),dictDO.getDictValue(),sessionId,
                            contentType+"", answer, "1",null);
                    //匹配问题是否关联其他配置;