Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datacollector
Overview
Overview
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
chenweisong
datacollector
Commits
1c654c41
Commit
1c654c41
authored
Apr 24, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
ae89901f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
TemplateController.java
...ava/com/keymobile/rest/controller/TemplateController.java
+9
-2
No files found.
src/main/java/com/keymobile/rest/controller/TemplateController.java
View file @
1c654c41
...
...
@@ -18,6 +18,8 @@ import io.swagger.annotations.*;
import
org.activiti.engine.*
;
import
org.activiti.engine.task.Task
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -30,6 +32,10 @@ import java.util.*;
@Api
(
tags
=
"模板 控制器"
,
description
=
"Template Mgr"
)
@RestController
public
class
TemplateController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TemplateController
.
class
);
@Autowired
private
FilePathService
filePathService
;
@Autowired
...
...
@@ -154,7 +160,7 @@ public class TemplateController {
@ApiImplicitParam
(
name
=
"missionType"
,
value
=
"任务类型"
,
dataType
=
"integer"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"/excel/getDataByFilePath"
)
public
Object
getDataByFilePath
(
String
filePath
,
long
templateId
,
Integer
missionType
)
{
public
Object
getDataByFilePath
(
long
templateId
,
Integer
missionType
)
{
Template
template
=
templateService
.
findById
(
templateId
);
Map
<
String
,
List
<
BankData
>>
breakResultMap
=
new
HashMap
<>();
try
{
...
...
@@ -162,7 +168,7 @@ public class TemplateController {
params
.
setTitleRows
(
1
);
params
.
setHeadRows
(
1
);
ExcelImportResult
<
BankData
>
excelImportResult
=
ExcelImportUtil
.
importExcelMore
(
new
FileInputStream
(
new
File
(
filePath
)),
BankData
.
class
,
params
);
importExcelMore
(
new
FileInputStream
(
new
File
(
template
.
getUpStreamAddr
()
)),
BankData
.
class
,
params
);
List
<
BankData
>
bankDataList
=
excelImportResult
.
getList
();
String
breakColumnEn
=
ExcelModelColumnUtils
.
getBreakColumn
(
template
.
getColumnName
());
if
(
StringUtils
.
isBlank
(
breakColumnEn
))
{
...
...
@@ -190,6 +196,7 @@ public class TemplateController {
User
user
=
sessionService
.
getLoginUser
();
Map
org
=
feignAuthService
.
getUserOrgById
(
user
.
getId
());
String
key
=
org
.
get
(
"fullname"
).
toString
().
split
(
","
)[
1
];
logger
.
info
(
"bank name {}"
,
key
);
List
<
BankData
>
bankDataList
=
breakResultMap
.
get
(
key
);
List
<
List
<
String
>>
listArrayList
=
new
ArrayList
<>();
bankDataList
.
forEach
(
bankData
->
{
...
...
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