Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
K
know-base
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
张京坤
know-base
Commits
a8c34c52
提交
a8c34c52
authored
7月 15, 2024
作者:
yanxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
根据模板数据导入逻辑优化
上级
adc7c161
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
23 行增加
和
12 行删除
+23
-12
KnowledgeServiceImpl.java
.../com/zzsn/knowbase/service/impl/KnowledgeServiceImpl.java
+23
-12
没有找到文件。
src/main/java/com/zzsn/knowbase/service/impl/KnowledgeServiceImpl.java
浏览文件 @
a8c34c52
...
...
@@ -777,7 +777,7 @@ class KnowledgeServiceImpl implements IKnowledgeService {
// 将MultipartFile的文件内容保存到字节数组
byte
[]
fileData
=
multipartFile
.
getBytes
();
List
<
List
<
String
>>
lists
=
ExcelExportUtil
.
readExcel
(
new
ByteArrayInputStream
(
fileData
),
1
,
5
);
List
<
List
<
String
>>
lists
=
ExcelExportUtil
.
readExcel
(
new
ByteArrayInputStream
(
fileData
),
1
,
8
);
//存入es
importInfo
(
lists
,
kbKnowledgeId
,
knowledgeProjectId
,
typeId
,
userId
);
}
catch
(
Exception
e
)
{
...
...
@@ -892,15 +892,23 @@ class KnowledgeServiceImpl implements IKnowledgeService {
.
verifyStatus
(
0
)
.
importData
(
1
)
.
build
();
specialInformation
.
setId
(
codeGenerateUtil
.
geneIdNo
(
Constants
.
FINANCE
,
8
));
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
0
)))
{
specialInformation
.
setTitle
(
info
.
get
(
0
));
specialInformation
.
setId
(
info
.
get
(
0
));
}
else
{
specialInformation
.
setId
(
codeGenerateUtil
.
geneIdNo
(
Constants
.
FINANCE
,
8
));
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
1
)))
{
specialInformation
.
setTitle
(
info
.
get
(
1
));
}
else
{
log
.
error
(
"上传的数据{}标题为空,此条数据忽略"
,
info
.
get
(
0
));
continue
;
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
1
)))
{
specialInformation
.
setContentWithTag
(
info
.
get
(
1
));
String
contentWithTag
=
info
.
get
(
3
);
if
(
StringUtils
.
isEmpty
(
contentWithTag
)){
contentWithTag
=
info
.
get
(
2
);
}
if
(
StringUtils
.
isNotEmpty
(
contentWithTag
))
{
specialInformation
.
setContentWithTag
(
contentWithTag
);
//片段切分
List
<
Content
>
contents
=
new
ArrayList
<>();
List
<
String
>
splitContents
=
HtmlUtil
.
splitContents
(
specialInformation
.
getContentWithTag
());
...
...
@@ -914,17 +922,20 @@ class KnowledgeServiceImpl implements IKnowledgeService {
}
specialInformation
.
setContents
(
contents
);
}
else
{
log
.
error
(
"上传的数据{}正文为空,此条数据忽略"
,
info
.
get
(
0
));
log
.
error
(
"上传的数据{}正文为空,此条数据忽略"
,
info
.
get
(
1
));
continue
;
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
2
)))
{
specialInformation
.
setAuthor
(
info
.
get
(
2
));
if
(
info
.
size
()>
4
&&
StringUtils
.
isNotEmpty
(
info
.
get
(
4
)))
{
specialInformation
.
setAuthor
(
info
.
get
(
4
));
}
if
(
info
.
size
()>
5
&&
StringUtils
.
isNotEmpty
(
info
.
get
(
5
)))
{
specialInformation
.
setOrigin
(
info
.
get
(
5
));
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
3
)))
{
specialInformation
.
set
Origin
(
info
.
get
(
3
));
if
(
info
.
size
()>
6
&&
StringUtils
.
isNotEmpty
(
info
.
get
(
6
)))
{
specialInformation
.
set
PublishDate
(
EsDateUtil
.
esFieldDateFormat
(
info
.
get
(
6
)
));
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
4
)))
{
specialInformation
.
set
PublishDate
(
EsDateUtil
.
esFieldDateFormat
(
info
.
get
(
4
)
));
if
(
info
.
size
()>
7
&&
StringUtils
.
isNotEmpty
(
info
.
get
(
7
)))
{
specialInformation
.
set
SourceAddress
(
info
.
get
(
7
));
}
specialInformation
.
setDeleteFlag
(
0
);
specialInformation
.
setCreateTime
(
EsDateUtil
.
esFieldDateFormat
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
formatDateTime
(
new
Date
())));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论