Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
a06e9b89
Commit
a06e9b89
authored
Jul 12, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:知识库导入迁移
parent
aaccb931
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
13 deletions
+30
-13
ExcelParserOld.java
...in/amos/knowledgebase/face/util/excel/ExcelParserOld.java
+0
-0
DocLibraryResource.java
...oin/amos/knowledgebase/controller/DocLibraryResource.java
+20
-5
DocCategoryService.java
...n/amos/knowledgebase/face/service/DocCategoryService.java
+10
-8
DocLibraryService.java
...in/amos/knowledgebase/face/service/DocLibraryService.java
+0
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-knowledgebase-api/src/main/java/com/yeejoin/amos/knowledgebase/face/util/excel/ExcelParserOld.java
0 → 100644
View file @
a06e9b89
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/controller/DocLibraryResource.java
View file @
a06e9b89
package
com
.
yeejoin
.
amos
.
knowledgebase
.
controller
;
package
com
.
yeejoin
.
amos
.
knowledgebase
.
controller
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
com.alibaba.fastjson.JSONArray
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -212,18 +214,31 @@ public class DocLibraryResource {
...
@@ -212,18 +214,31 @@ public class DocLibraryResource {
docLibraryService
.
export
(
id
,
type
,
response
);
docLibraryService
.
export
(
id
,
type
,
response
);
}
}
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "导入excel文档")
// @RequestMapping(value = "/import", method = RequestMethod.POST)
// public ResponseModel importExcel(@RequestPart(value = "file") MultipartFile file,
// @RequestPart(value = "module") String moduleStr) {
// ExcelImportConfig excelConfig;
// try {
// excelConfig = JSON.parseObject(moduleStr, ExcelImportConfig.class);
// } catch (Exception e) {
// throw new BadRequest("模板配置信息格式有误");
// }
// return ResponseHelper.buildResponse(docLibraryService.importExcel(file, excelConfig));
// }
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导入excel文档"
)
@ApiOperation
(
value
=
"导入excel文档"
)
@RequestMapping
(
value
=
"/import"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/import"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
importExcel
(
@RequestPart
(
value
=
"file"
)
MultipartFile
file
,
public
ResponseModel
importExcel
(
@RequestPart
(
value
=
"file"
)
MultipartFile
file
,
@RequestPart
(
value
=
"module"
)
String
moduleStr
)
{
@RequestPart
(
value
=
"module"
)
String
moduleStr
)
{
List
<
ExcelImportConfig
>
excelConfigList
;
ExcelImportConfig
excelConfig
;
try
{
try
{
excelConfig
=
JSON
.
parseObject
(
moduleStr
,
ExcelImportConfig
.
class
);
excelConfig
List
=
JSONArray
.
parseArray
(
moduleStr
,
ExcelImportConfig
.
class
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"模板配置信息格式有误"
);
throw
new
BadRequest
(
"模板配置信息格式有误"
);
}
}
return
ResponseHelper
.
buildResponse
(
docLibraryService
.
importExcel
(
file
,
excelConfig
));
return
ResponseHelper
.
buildResponse
(
docLibraryService
.
importExcel
(
file
,
excelConfig
List
));
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/face/service/DocCategoryService.java
View file @
a06e9b89
package
com
.
yeejoin
.
amos
.
knowledgebase
.
face
.
service
;
package
com
.
yeejoin
.
amos
.
knowledgebase
.
face
.
service
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.SortedSet
;
import
java.util.TreeSet
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -257,4 +250,13 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K
...
@@ -257,4 +250,13 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K
List
<
KnowledgeDocCategoryModel
>
categoryModelList
=
this
.
queryForList
(
null
,
true
,
categoryName
,
parentId
);
List
<
KnowledgeDocCategoryModel
>
categoryModelList
=
this
.
queryForList
(
null
,
true
,
categoryName
,
parentId
);
return
categoryModelList
.
isEmpty
()
?
null
:
categoryModelList
.
get
(
0
);
return
categoryModelList
.
isEmpty
()
?
null
:
categoryModelList
.
get
(
0
);
}
}
public
Map
<
String
,
Long
>
getGroupNameValue
(
List
<
Long
>
ids
)
{
List
<
KnowledgeDocCategoryModel
>
list
=
this
.
queryBatchSeq
(
ids
);
Map
<
String
,
Long
>
result
=
new
HashMap
<>();
for
(
KnowledgeDocCategoryModel
knowledgeDocCategoryModel:
list
)
{
result
.
put
(
knowledgeDocCategoryModel
.
getCategoryName
(),
knowledgeDocCategoryModel
.
getSequenceNbr
());
}
return
result
;
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-knowledgebase-biz/src/main/java/com/yeejoin/amos/knowledgebase/face/service/DocLibraryService.java
View file @
a06e9b89
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment