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
376114b1
Commit
376114b1
authored
May 29, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update codes
parent
b9870905
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
82 additions
and
19 deletions
+82
-19
.DS_Store
.DS_Store
+0
-0
workspace.xml
.idea/workspace.xml
+5
-3
workspace.xml
lib/java/bi-report-service/.idea/workspace.xml
+11
-11
BiReportEndpoint.java
...m/gmei/data/gateway/server/endpoint/BiReportEndpoint.java
+6
-0
BiReportService.java
...com/gmei/data/gateway/server/service/BiReportService.java
+1
-0
HivesqlService.java
.../com/gmei/data/gateway/server/service/HivesqlService.java
+0
-2
SparksqlService.java
...com/gmei/data/gateway/server/service/SparksqlService.java
+1
-0
BiReportServiceImpl.java
...data/gateway/server/service/impl/BiReportServiceImpl.java
+5
-0
HivesqlServiceImpl.java
.../data/gateway/server/service/impl/HivesqlServiceImpl.java
+3
-3
SparksqlServiceImpl.java
...data/gateway/server/service/impl/SparksqlServiceImpl.java
+50
-0
No files found.
.DS_Store
View file @
376114b1
No preview for this file type
.idea/workspace.xml
View file @
376114b1
...
...
@@ -58,7 +58,7 @@
<property
name=
"WebServerToolWindowFactoryState"
value=
"false"
/>
<property
name=
"aspect.path.notification.shown"
value=
"true"
/>
<property
name=
"ignore_missing_gitignore"
value=
"true"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$
/bin
"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"project.structure.last.edited"
value=
"Global Libraries"
/>
<property
name=
"project.structure.proportion"
value=
"0.0"
/>
<property
name=
"project.structure.side.proportion"
value=
"0.2"
/>
...
...
@@ -127,6 +127,7 @@
<workItem
from=
"1588761853482"
duration=
"3826000"
/>
<workItem
from=
"1588905392183"
duration=
"4522000"
/>
<workItem
from=
"1589447155495"
duration=
"19738000"
/>
<workItem
from=
"1590723962134"
duration=
"470000"
/>
</task>
<task
id=
"LOCAL-00001"
summary=
"add init codes."
>
<created>
1587723565207
</created>
...
...
@@ -407,10 +408,11 @@
<state
x=
"560"
y=
"344"
key=
"Vcs.Push.Dialog.v2/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@0.22.1920.1178"
timestamp=
"1589536752839"
/>
<state
x=
"560"
y=
"312"
key=
"Vcs.Push.Dialog.v2/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"1588232541898"
/>
<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=
"
625"
y=
"409"
key=
"git4idea.merge.GitPullDialog"
timestamp=
"158953463934
4"
>
<screen
x=
"
0"
y=
"22"
width=
"1920"
height=
"1178
"
/>
<state
x=
"
2377"
y=
"1578"
key=
"git4idea.merge.GitPullDialog"
timestamp=
"159072399338
4"
>
<screen
x=
"
1752"
y=
"1200"
width=
"1920"
height=
"1151
"
/>
</state>
<state
x=
"625"
y=
"409"
key=
"git4idea.merge.GitPullDialog/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@0.22.1920.1178"
timestamp=
"1589534639344"
/>
<state
x=
"2377"
y=
"1578"
key=
"git4idea.merge.GitPullDialog/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"1590723993384"
/>
<state
x=
"578"
y=
"284"
key=
"search.everywhere.popup"
timestamp=
"1590043229933"
>
<screen
x=
"0"
y=
"22"
width=
"1920"
height=
"1178"
/>
</state>
...
...
lib/java/bi-report-service/.idea/workspace.xml
View file @
376114b1
...
...
@@ -216,7 +216,7 @@
<workItem
from=
"1588762492573"
duration=
"403000"
/>
<workItem
from=
"1588837331043"
duration=
"673000"
/>
<workItem
from=
"1589455301393"
duration=
"17006000"
/>
<workItem
from=
"1590398287572"
duration=
"
31
49000"
/>
<workItem
from=
"1590398287572"
duration=
"
84
49000"
/>
</task>
<servers
/>
</component>
...
...
@@ -286,32 +286,32 @@
</state>
<state
x=
"553"
y=
"153"
key=
"CommitChangelistDialog2/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"1584956237641"
/>
<state
x=
"784"
y=
"1223"
key=
"CommitChangelistDialog2/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1588154132365"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.bottom"
timestamp=
"15904
0203083
9"
>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.bottom"
timestamp=
"15904
8736926
9"
>
<screen
x=
"1752"
y=
"1200"
width=
"1920"
height=
"1151"
/>
</state>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.bottom/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1588761074648"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.bottom/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15904
0203083
9"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.bottom/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15904
8736926
9"
/>
<state
width=
"1878"
height=
"321"
key=
"GridCell.Tab.0.bottom/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"1584688137007"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.bottom/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1588838004638"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.center"
timestamp=
"15904
02030838
"
>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.center"
timestamp=
"15904
87369267
"
>
<screen
x=
"1752"
y=
"1200"
width=
"1920"
height=
"1151"
/>
</state>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.center/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1588761074647"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.center/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15904
02030838
"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.center/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15904
87369267
"
/>
<state
width=
"1878"
height=
"321"
key=
"GridCell.Tab.0.center/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"1584688137005"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.center/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1588838004637"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.left"
timestamp=
"15904
02030837
"
>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.left"
timestamp=
"15904
87369265
"
>
<screen
x=
"1752"
y=
"1200"
width=
"1920"
height=
"1151"
/>
</state>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.left/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1588761074647"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.left/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15904
02030837
"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.left/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15904
87369265
"
/>
<state
width=
"1878"
height=
"321"
key=
"GridCell.Tab.0.left/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"1584688137005"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.left/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1588838004636"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.right"
timestamp=
"15904
0203083
8"
>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.right"
timestamp=
"15904
8736926
8"
>
<screen
x=
"1752"
y=
"1200"
width=
"1920"
height=
"1151"
/>
</state>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.right/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1588761074648"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.right/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15904
0203083
8"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.right/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15904
8736926
8"
/>
<state
width=
"1878"
height=
"321"
key=
"GridCell.Tab.0.right/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"1584688137006"
/>
<state
width=
"1878"
height=
"243"
key=
"GridCell.Tab.0.right/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1588838004637"
/>
<state
width=
"1878"
height=
"395"
key=
"GridCell.Tab.1.bottom"
timestamp=
"1590137977817"
>
...
...
@@ -338,11 +338,11 @@
<screen
x=
"0"
y=
"22"
width=
"1920"
height=
"1058"
/>
</state>
<state
x=
"560"
y=
"291"
key=
"Vcs.Push.Dialog.v2/246.1080.1920.1151/0.22.1920.1058@0.22.1920.1058"
timestamp=
"1584949293518"
/>
<state
x=
"2221"
y=
"1390"
width=
"670"
height=
"675"
key=
"run.anything.popup"
timestamp=
"15
89943863616
"
>
<state
x=
"2221"
y=
"1390"
width=
"670"
height=
"675"
key=
"run.anything.popup"
timestamp=
"15
90402203344
"
>
<screen
x=
"1752"
y=
"1200"
width=
"1920"
height=
"1151"
/>
</state>
<state
x=
"469"
y=
"208"
width=
"670"
height=
"663"
key=
"run.anything.popup/0.22.1920.1129@0.22.1920.1129"
timestamp=
"1588345465540"
/>
<state
x=
"2221"
y=
"1390"
width=
"670"
height=
"675"
key=
"run.anything.popup/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15
89943863616
"
/>
<state
x=
"2221"
y=
"1390"
width=
"670"
height=
"675"
key=
"run.anything.popup/1752.1200.1920.1151/0.22.1920.1178/1920.120.1920.1080@1752.1200.1920.1151"
timestamp=
"15
90402203344
"
/>
<state
x=
"715"
y=
"1270"
width=
"670"
height=
"675"
key=
"run.anything.popup/246.1080.1920.1151/0.22.1920.1058@246.1080.1920.1151"
timestamp=
"1588837938694"
/>
<state
x=
"2330"
y=
"1458"
width=
"764"
height=
"676"
key=
"search.everywhere.popup"
timestamp=
"1589943432014"
>
<screen
x=
"1752"
y=
"1200"
width=
"1920"
height=
"1151"
/>
...
...
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/endpoint/BiReportEndpoint.java
View file @
376114b1
...
...
@@ -17,6 +17,12 @@ public class BiReportEndpoint {
return
biReportService
.
execSql
(
name
);
}
@ResponseBody
@RequestMapping
(
value
=
"/execSqlByHive"
)
public
int
execSqlByHive
(
@RequestParam
String
name
){
return
biReportService
.
execSql
(
name
);
}
@ResponseBody
@RequestMapping
(
value
=
"/genExcel"
)
public
int
genExcel
(
@RequestParam
String
name
){
...
...
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/BiReportService.java
View file @
376114b1
...
...
@@ -2,6 +2,7 @@ package com.gmei.data.gateway.server.service;
public
interface
BiReportService
{
int
execSql
(
String
name
);
int
execSqlByHive
(
String
name
);
int
genExcel
(
String
name
);
int
sendEmail
(
String
to
,
String
cc
,
String
name
);
}
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/HivesqlService.java
View file @
376114b1
package
com
.
gmei
.
data
.
gateway
.
server
.
service
;
import
com.gmei.data.gateway.server.dto.ExcelGenDto
;
public
interface
HivesqlService
{
int
executeSql
(
String
name
);
}
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/SparksqlService.java
View file @
376114b1
...
...
@@ -3,5 +3,6 @@ package com.gmei.data.gateway.server.service;
import
com.gmei.data.gateway.server.dto.ExcelGenDto
;
public
interface
SparksqlService
{
int
executeSql
(
String
name
);
ExcelGenDto
getResultDto
(
String
name
);
}
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/impl/BiReportServiceImpl.java
View file @
376114b1
...
...
@@ -26,6 +26,11 @@ public class BiReportServiceImpl implements BiReportService {
@Override
public
int
execSql
(
String
name
){
return
sparksqlService
.
executeSql
(
name
);
}
@Override
public
int
execSqlByHive
(
String
name
){
return
hivesqlService
.
executeSql
(
name
);
}
...
...
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/impl/HivesqlServiceImpl.java
View file @
376114b1
...
...
@@ -68,13 +68,13 @@ public class HivesqlServiceImpl implements HivesqlService {
statement
.
executeUpdate
(
"set mapreduce.job.queuename=data"
);
int
updateCount
=
statement
.
executeUpdate
(
hql
);
if
(
updateCount
>
0
){
logger
.
info
(
"*** Execute success, hql: {}"
,
hql
);
logger
.
info
(
"*** Execute
By Hive
success, hql: {}"
,
hql
);
}
else
{
logger
.
warn
(
"*** Execute finish, hql: {}"
,
hql
);
logger
.
warn
(
"*** Execute
By Hive
finish, hql: {}"
,
hql
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
error
(
"*** Execute failed, error message: {}, hql: {}"
,
e
.
getMessage
(),
hql
);
logger
.
error
(
"*** Execute
By Hive
failed, error message: {}, hql: {}"
,
e
.
getMessage
(),
hql
);
return
1
;
}
}
...
...
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/impl/SparksqlServiceImpl.java
View file @
376114b1
...
...
@@ -33,6 +33,56 @@ public class SparksqlServiceImpl implements SparksqlService {
private
String
properFilePath
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SparksqlServiceImpl
.
class
);
@Override
public
int
executeSql
(
String
name
){
File
sqlDir
=
new
File
(
sqlPath
+
name
);
File
[]
files
=
sqlDir
.
listFiles
();
for
(
File
file
:
files
){
BufferedReader
reader
=
null
;
StringBuffer
sbf
=
new
StringBuffer
();
try
{
reader
=
new
BufferedReader
(
new
FileReader
(
file
));
String
tempStr
;
while
((
tempStr
=
reader
.
readLine
())
!=
null
)
{
sbf
.
append
(
"\t"
).
append
(
tempStr
);
}
reader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
logger
.
error
(
e
.
getMessage
());
continue
;
}
finally
{
if
(
reader
!=
null
)
{
try
{
reader
.
close
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
logger
.
error
(
e1
.
getMessage
());
continue
;
}
}
}
String
hql
=
sbf
.
toString
();
Connection
conn
=
null
;
try
{
conn
=
DriverManager
.
getConnection
(
sparkSqlJdbcUrl
,
"bi"
,
""
);
Statement
statement
=
conn
.
createStatement
();
int
updateCount
=
statement
.
executeUpdate
(
hql
);
if
(
updateCount
>
0
){
logger
.
info
(
"*** Execute By Sparksql success, hql: {}"
,
hql
);
}
else
{
logger
.
warn
(
"*** Execute By Sparksql finish, hql: {}"
,
hql
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
error
(
"*** Execute By Sparksql failed, error message: {}, hql: {}"
,
e
.
getMessage
(),
hql
);
return
1
;
}
}
return
0
;
}
@Override
public
ExcelGenDto
getResultDto
(
String
name
){
List
<
String
>
sheetNameList
=
new
ArrayList
<
String
>();
...
...
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