|
@ -49,6 +49,33 @@ public class RobotService {
|
|
|
@Autowired
|
|
|
private HospitalSysDictDao hospitalSysDictDao;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 发送卡片
|
|
|
* @param session_id
|
|
|
* @param type 会话类型
|
|
|
* @param cardType 1 常见问题 2科室医生 3 症状描述
|
|
|
*/
|
|
|
public void sendCard(String session_id,String type,String cardType){
|
|
|
if("1".equals(cardType)){
|
|
|
//1常见问题
|
|
|
List<BaseKnowledgeQuestion> questionList = knowledgeQuestionDao.findTopList(DateUtil.getStringDate(),5);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (BaseKnowledgeQuestion question:questionList){
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id",question.getId());
|
|
|
json.put("questionName",question.getQuestionName());
|
|
|
jsonArray.add(jsonArray);
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("content",jsonArray);
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonQuestion);
|
|
|
result.put("session_id",session_id);
|
|
|
sendReply(result);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取发送者
|
|
|
public WlyyHospitalSysDictDO getSender(){
|
|
|
WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findById("customer").orElse(null);
|
|
@ -187,7 +214,7 @@ public class RobotService {
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("content",jsonArray);
|
|
|
result.put("content_type","3001");
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonQuestion);
|
|
|
result.put("session_id",session_id);
|
|
|
map.put("2",result);
|
|
|
}else if(relaitonCodeType==2){
|
|
@ -201,7 +228,7 @@ public class RobotService {
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("content",jsonArray);
|
|
|
result.put("content_type","3003");
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonDict);
|
|
|
result.put("session_id",session_id);
|
|
|
map.put("2",result);
|
|
|
}else if(relaitonCodeType==3){
|
|
@ -226,7 +253,7 @@ public class RobotService {
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("content",jsonArray);
|
|
|
result.put("content_type","3002");
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonQuestions);
|
|
|
result.put("session_id",session_id);
|
|
|
map.put("2",result);
|
|
|
}
|