Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bi-report
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
data
bi-report
Commits
99bbecc8
Commit
99bbecc8
authored
Apr 30, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update codes
parent
3eea8c3e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
18 deletions
+39
-18
workspace.xml
.idea/workspace.xml
+9
-6
compiler.xml
lib/java/bi-report-service/.idea/compiler.xml
+6
-1
workspace.xml
lib/java/bi-report-service/.idea/workspace.xml
+4
-2
pom.xml
lib/java/bi-report-service/service-server/pom.xml
+1
-1
service-server.iml
lib/java/bi-report-service/service-server/service-server.iml
+2
-2
BiReportEndpoint.java
...m/gmei/data/gateway/server/endpoint/BiReportEndpoint.java
+5
-0
SparksqlService.java
...com/gmei/data/gateway/server/service/SparksqlService.java
+1
-1
SparksqlServiceImpl.java
...data/gateway/server/service/impl/SparksqlServiceImpl.java
+6
-4
application.yml
...service/service-server/src/main/resources/application.yml
+5
-1
No files found.
.idea/workspace.xml
View file @
99bbecc8
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"18c38e3b-9b7f-4a3f-b141-edcb320b1d24"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"true"
id=
"18c38e3b-9b7f-4a3f-b141-edcb320b1d24"
name=
"Default Changelist"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/sbin/stop_service.sh"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/sbin/start_service.sh"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/sbin/start_service.sh"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
...
@@ -118,7 +121,7 @@
...
@@ -118,7 +121,7 @@
<workItem
from=
"1587982524517"
duration=
"5052000"
/>
<workItem
from=
"1587982524517"
duration=
"5052000"
/>
<workItem
from=
"1588152481879"
duration=
"139000"
/>
<workItem
from=
"1588152481879"
duration=
"139000"
/>
<workItem
from=
"1588154352798"
duration=
"195000"
/>
<workItem
from=
"1588154352798"
duration=
"195000"
/>
<workItem
from=
"1588220085338"
duration=
"
3660
000"
/>
<workItem
from=
"1588220085338"
duration=
"
4099
000"
/>
</task>
</task>
<task
id=
"LOCAL-00001"
summary=
"add init codes."
>
<task
id=
"LOCAL-00001"
summary=
"add init codes."
>
<created>
1587723565207
</created>
<created>
1587723565207
</created>
...
@@ -318,11 +321,11 @@
...
@@ -318,11 +321,11 @@
<screen
x=
"246"
y=
"1080"
width=
"1920"
height=
"1151"
/>
<screen
x=
"246"
y=
"1080"
width=
"1920"
height=
"1151"
/>
</state>
</state>
<state
x=
"826"
y=
"1351"
key=
"#com.intellij.ide.util.frameworkSupport.AddFrameworkSupportDialog/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1587720303076"
/>
<state
x=
"826"
y=
"1351"
key=
"#com.intellij.ide.util.frameworkSupport.AddFrameworkSupportDialog/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1587720303076"
/>
<state
x=
"554"
y=
"186"
key=
"CommitChangelistDialog2"
timestamp=
"158823
1605201
"
>
<state
x=
"554"
y=
"186"
key=
"CommitChangelistDialog2"
timestamp=
"158823
2534973
"
>
<screen
x=
"0"
y=
"22"
width=
"1920"
height=
"1058"
/>
<screen
x=
"0"
y=
"22"
width=
"1920"
height=
"1058"
/>
</state>
</state>
<state
x=
"554"
y=
"197"
key=
"CommitChangelistDialog2/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1587891829124"
/>
<state
x=
"554"
y=
"197"
key=
"CommitChangelistDialog2/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1587891829124"
/>
<state
x=
"554"
y=
"186"
key=
"CommitChangelistDialog2/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"158823
1605201
"
/>
<state
x=
"554"
y=
"186"
key=
"CommitChangelistDialog2/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"158823
2534973
"
/>
<state
x=
"800"
y=
"1258"
key=
"CommitChangelistDialog2/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1587900238196"
/>
<state
x=
"800"
y=
"1258"
key=
"CommitChangelistDialog2/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1587900238196"
/>
<state
x=
"1038"
y=
"1373"
key=
"RollbackChangesDialog"
timestamp=
"1587898773703"
>
<state
x=
"1038"
y=
"1373"
key=
"RollbackChangesDialog"
timestamp=
"1587898773703"
>
<screen
x=
"246"
y=
"1080"
width=
"1920"
height=
"1151"
/>
<screen
x=
"246"
y=
"1080"
width=
"1920"
height=
"1151"
/>
...
@@ -332,11 +335,11 @@
...
@@ -332,11 +335,11 @@
<screen
x=
"246"
y=
"1080"
width=
"1920"
height=
"1151"
/>
<screen
x=
"246"
y=
"1080"
width=
"1920"
height=
"1151"
/>
</state>
</state>
<state
x=
"694"
y=
"1237"
key=
"SettingsEditor/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1587720319782"
/>
<state
x=
"694"
y=
"1237"
key=
"SettingsEditor/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1587720319782"
/>
<state
x=
"560"
y=
"312"
key=
"Vcs.Push.Dialog.v2"
timestamp=
"158823
1607137
"
>
<state
x=
"560"
y=
"312"
key=
"Vcs.Push.Dialog.v2"
timestamp=
"158823
2541898
"
>
<screen
x=
"0"
y=
"22"
width=
"1920"
height=
"1058"
/>
<screen
x=
"0"
y=
"22"
width=
"1920"
height=
"1058"
/>
</state>
</state>
<state
x=
"560"
y=
"331"
key=
"Vcs.Push.Dialog.v2/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1587891830625"
/>
<state
x=
"560"
y=
"331"
key=
"Vcs.Push.Dialog.v2/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1587891830625"
/>
<state
x=
"560"
y=
"312"
key=
"Vcs.Push.Dialog.v2/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"158823
1607137
"
/>
<state
x=
"560"
y=
"312"
key=
"Vcs.Push.Dialog.v2/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"158823
2541898
"
/>
<state
x=
"806"
y=
"1395"
key=
"Vcs.Push.Dialog.v2/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1587900239771"
/>
<state
x=
"806"
y=
"1395"
key=
"Vcs.Push.Dialog.v2/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1587900239771"
/>
<state
x=
"578"
y=
"257"
key=
"search.everywhere.popup"
timestamp=
"1588231057499"
>
<state
x=
"578"
y=
"257"
key=
"search.everywhere.popup"
timestamp=
"1588231057499"
>
<screen
x=
"0"
y=
"22"
width=
"1920"
height=
"1058"
/>
<screen
x=
"0"
y=
"22"
width=
"1920"
height=
"1058"
/>
...
...
lib/java/bi-report-service/.idea/compiler.xml
View file @
99bbecc8
...
@@ -6,9 +6,14 @@
...
@@ -6,9 +6,14 @@
<sourceOutputDir
name=
"target/generated-sources/annotations"
/>
<sourceOutputDir
name=
"target/generated-sources/annotations"
/>
<sourceTestOutputDir
name=
"target/generated-test-sources/test-annotations"
/>
<sourceTestOutputDir
name=
"target/generated-test-sources/test-annotations"
/>
<outputRelativeToContentRoot
value=
"true"
/>
<outputRelativeToContentRoot
value=
"true"
/>
<module
name=
"service-server"
/>
<module
name=
"service-client"
/>
<module
name=
"service-client"
/>
</profile>
</profile>
<profile
name=
"Annotation profile for bi-report-service"
enabled=
"true"
>
<sourceOutputDir
name=
"../../../../../target/generated-sources/annotations"
/>
<sourceTestOutputDir
name=
"../../../../../target/generated-test-sources/test-annotations"
/>
<outputRelativeToContentRoot
value=
"true"
/>
<module
name=
"service-server"
/>
</profile>
</annotationProcessing>
</annotationProcessing>
<bytecodeTargetLevel>
<bytecodeTargetLevel>
<module
name=
"bi-report-service"
target=
"1.5"
/>
<module
name=
"bi-report-service"
target=
"1.5"
/>
...
...
lib/java/bi-report-service/.idea/workspace.xml
View file @
99bbecc8
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"73604af3-3cbc-41f8-9a5f-e6a14a2ada76"
name=
"Default Changelist"
comment=
"add"
/>
<list
default=
"true"
id=
"73604af3-3cbc-41f8-9a5f-e6a14a2ada76"
name=
"Default Changelist"
comment=
"add"
>
<change
afterPath=
"$PROJECT_DIR$/../../../sbin/stop_service.sh"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
...
@@ -214,7 +216,7 @@
...
@@ -214,7 +216,7 @@
<workItem
from=
"1584945647680"
duration=
"4469000"
/>
<workItem
from=
"1584945647680"
duration=
"4469000"
/>
<workItem
from=
"1588148891822"
duration=
"2318000"
/>
<workItem
from=
"1588148891822"
duration=
"2318000"
/>
<workItem
from=
"1588152718016"
duration=
"1463000"
/>
<workItem
from=
"1588152718016"
duration=
"1463000"
/>
<workItem
from=
"1588154601852"
duration=
"1
5633
000"
/>
<workItem
from=
"1588154601852"
duration=
"1
6184
000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
...
...
lib/java/bi-report-service/service-server/pom.xml
View file @
99bbecc8
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
service-server
</artifactId>
<artifactId>
bi-report-service
</artifactId>
<properties>
<properties>
<java.version>
1.8
</java.version>
<java.version>
1.8
</java.version>
...
...
lib/java/bi-report-service/service-server/service-server.iml
View file @
99bbecc8
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
</facet>
</facet>
</component>
</component>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_6"
>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_6"
>
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output
url=
"file://$MODULE_DIR$/
../../../../../
target/classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<output-test
url=
"file://$MODULE_DIR$/
../../../../../
target/test-classes"
/>
<content
url=
"file://$MODULE_DIR$"
>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/resources"
type=
"java-resource"
/>
...
...
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/endpoint/BiReportEndpoint.java
View file @
99bbecc8
package
com
.
gmei
.
data
.
gateway
.
server
.
endpoint
;
package
com
.
gmei
.
data
.
gateway
.
server
.
endpoint
;
import
com.gmei.data.gateway.server.dto.ExcelGenDto
;
import
com.gmei.data.gateway.server.service.ExcelService
;
import
com.gmei.data.gateway.server.service.ExcelService
;
import
com.gmei.data.gateway.server.service.EmailService
;
import
com.gmei.data.gateway.server.service.EmailService
;
import
com.gmei.data.gateway.server.service.SparksqlService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -16,10 +18,13 @@ public class BiReportEndpoint {
...
@@ -16,10 +18,13 @@ public class BiReportEndpoint {
public
EmailService
emailService
;
public
EmailService
emailService
;
@Autowired
@Autowired
public
ExcelService
excelService
;
public
ExcelService
excelService
;
@Autowired
public
SparksqlService
sparksqlService
;
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"/genExcel"
)
@RequestMapping
(
value
=
"/genExcel"
)
public
int
genExcel
(
@RequestParam
String
hql
){
public
int
genExcel
(
@RequestParam
String
hql
){
ExcelGenDto
resultDto
=
sparksqlService
.
getResultDto
(
hql
);
return
0
;
return
0
;
}
}
...
...
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/SparksqlService.java
View file @
99bbecc8
...
@@ -3,5 +3,5 @@ package com.gmei.data.gateway.server.service;
...
@@ -3,5 +3,5 @@ package com.gmei.data.gateway.server.service;
import
com.gmei.data.gateway.server.dto.ExcelGenDto
;
import
com.gmei.data.gateway.server.dto.ExcelGenDto
;
public
interface
SparksqlService
{
public
interface
SparksqlService
{
ExcelGenDto
getResultDto
(
String
sqlPath
);
ExcelGenDto
getResultDto
(
String
name
);
}
}
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/impl/SparksqlServiceImpl.java
View file @
99bbecc8
...
@@ -24,17 +24,19 @@ import java.util.List;
...
@@ -24,17 +24,19 @@ import java.util.List;
@Service
@Service
public
class
SparksqlServiceImpl
implements
SparksqlService
{
public
class
SparksqlServiceImpl
implements
SparksqlService
{
@Value
(
"${sql.input.path}"
)
private
String
sqlPath
;
@Value
(
"${datasource.sparksql.jdbcUrl}"
)
@Value
(
"${datasource.sparksql.jdbcUrl}"
)
private
String
sparksqlJdbcUrl
;
private
String
sparksqlJdbcUrl
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SparksqlServiceImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SparksqlServiceImpl
.
class
);
@Override
@Override
public
ExcelGenDto
getResultDto
(
String
sqlPath
){
public
ExcelGenDto
getResultDto
(
String
name
){
List
<
String
>
sheetNameList
=
new
ArrayList
<
String
>();
List
<
String
>
sheetNameList
=
new
ArrayList
<
String
>();
List
<
List
<
String
>>
headersList
=
new
ArrayList
<
List
<
String
>>();
List
<
List
<
String
>>
headersList
=
new
ArrayList
<
List
<
String
>>();
List
<
List
<
List
>>
rowsList
=
new
ArrayList
<
List
<
List
>>();
List
<
List
<
List
>>
rowsList
=
new
ArrayList
<
List
<
List
>>();
File
sqlDir
=
new
File
(
sqlPath
);
File
sqlDir
=
new
File
(
sqlPath
+
name
);
File
[]
files
=
sqlDir
.
listFiles
();
File
[]
files
=
sqlDir
.
listFiles
();
for
(
File
file
:
files
){
for
(
File
file
:
files
){
String
fileName
=
file
.
getName
();
String
fileName
=
file
.
getName
();
...
@@ -75,8 +77,8 @@ public class SparksqlServiceImpl implements SparksqlService {
...
@@ -75,8 +77,8 @@ public class SparksqlServiceImpl implements SparksqlService {
ResultSetMetaData
metaData
=
rs
.
getMetaData
();
ResultSetMetaData
metaData
=
rs
.
getMetaData
();
int
columnCount
=
metaData
.
getColumnCount
();
int
columnCount
=
metaData
.
getColumnCount
();
for
(
int
i
=
1
;
i
<=
columnCount
;
i
++){
for
(
int
i
=
1
;
i
<=
columnCount
;
i
++){
String
n
ame
=
metaData
.
getCatalogName
(
i
);
String
catalogN
ame
=
metaData
.
getCatalogName
(
i
);
headers
.
add
(
n
ame
);
headers
.
add
(
catalogN
ame
);
}
}
while
(
rs
.
next
()){
while
(
rs
.
next
()){
List
<
String
>
rowVals
=
new
ArrayList
<
String
>();
List
<
String
>
rowVals
=
new
ArrayList
<
String
>();
...
...
lib/java/bi-report-service/service-server/src/main/resources/application.yml
View file @
99bbecc8
server
:
server
:
port
:
8
970
port
:
8
553
spring
:
spring
:
#---email config---
#---email config---
...
@@ -21,6 +21,10 @@ mail:
...
@@ -21,6 +21,10 @@ mail:
toMail
:
toMail
:
bcc
:
zhaojianwei@igengmei.com
bcc
:
zhaojianwei@igengmei.com
#---sql path---
sql
:
input
:
path
:
/home/bi/bi-report/sqls/
#---excel config---
#---excel config---
excel
:
excel
:
...
...
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