提交 34c1e59c 作者: obcy

Merge remote-tracking branch 'origin/master'

......@@ -75,6 +75,12 @@ public class KnowledgeController {
@GetMapping(value = "/getById")
public Result<?> getById(@RequestParam String id) {
KnowledgeVO knowledgeVO=knowledgeService.getById(id);
if(null!=knowledgeVO.getPublishDate()&&(!knowledgeVO.getPublishDate().isEmpty())){
knowledgeVO.setPublishDate(EsDateUtil.esFieldDateMapping(knowledgeVO.getPublishDate()));
}
if(null!=knowledgeVO.getVerifyTime()&&(!knowledgeVO.getVerifyTime().isEmpty())){
knowledgeVO.setVerifyTime(EsDateUtil.esFieldDateMapping(knowledgeVO.getVerifyTime()));
}
return Result.OK(knowledgeVO);
}
......@@ -163,6 +169,7 @@ public class KnowledgeController {
@PostMapping(value = "/IntelligentQa")
public Result<?> intelligentQa(@RequestBody IntelligentQaParam intelligentQaParam) throws IOException {
JSONObject params = new JSONObject();
params.put("score_threshold",intelligentQaParam.getScoreThreshold() );
params.put("question", intelligentQaParam.getQuestion());
params.put("knowledge_base_id", intelligentQaParam.getKbKnowledgeIds().split(","));
String result = HttpUtil.doPost(intelligentQaUrl, params, 120000);
......
......@@ -102,7 +102,7 @@ public class Knowledge implements Serializable {
* 知识库id
*/
private String kbKnowledgeId;
private String content;
private String contentAll;
/**
* 类型
*/
......
......@@ -21,5 +21,5 @@ public interface KnowledgeChannel {
MessageChannel knowledgeContents();
@Output
MessageChannel knowledgeExcelContents();
MessageChannel knowledgeExcels();
}
......@@ -50,6 +50,7 @@ public class KnowledgeMessage {
*/
private String type;
private String author;
private String contentAll;
private List<Content> contents;
......
......@@ -36,6 +36,6 @@ public class ProduceInfo {
public void sendKnowledgeExcelContents(KnowledgeMessage knowledgeMessage) {
String msg = JSON.toJSONString(knowledgeMessage);
Message<String> message = MessageBuilder.withPayload(msg).build();
channel.knowledgeExcelContents().send(message);
channel.knowledgeExcels().send(message);
}
}
......@@ -145,11 +145,6 @@ class KnowledgeServiceImpl implements IKnowledgeService {
}
knowledge.setContents(contentList);
knowledgeMessage.setContents(contentList);
} else {
if (null == knowledge.getContents().get(0).getContentId()) {
knowledge.getContents().get(0).setContentId(codeGenerateUtil.geneIdNo(Constants.FINANCE, 8));
}
knowledgeMessage.setContents(knowledge.getContents());
}
//id为空表示新增
if (null == knowledge.getId()) {
......@@ -518,12 +513,11 @@ class KnowledgeServiceImpl implements IKnowledgeService {
continue;
}
if (StringUtils.isNotEmpty(info.get(1))) {
specialInformation.setContent(info.get(1));
//段落切分
specialInformation.setContents(Collections.singletonList(Content.builder()
.contentId(codeGenerateUtil.geneIdNo(Constants.FINANCE, 8))
.content(info.get(1)).build()));
specialInformation.setContentAll(info.get(1));
// //段落切分
// specialInformation.setContents(Collections.singletonList(Content.builder()
// .contentId(codeGenerateUtil.geneIdNo(Constants.FINANCE, 8))
// .content(info.get(1)).build()));
} else {
log.error("上传的数据{}正文为空,此条数据忽略", info.get(0));
continue;
......
......@@ -15,5 +15,6 @@ public class IntelligentQaParam {
*/
private String question;
private String kbKnowledgeIds;
private Integer scoreThreshold=700;
}
......@@ -31,6 +31,7 @@ public class KnowledgeVO {
private String verifierName;
private String origin;
private String author;
private String contentAll;
private Integer score;
private Integer verifyStatus;
private Integer importData;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论