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
d6930096
Commit
d6930096
authored
Apr 30, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update codes
parent
11067eaa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
13 deletions
+12
-13
workspace.xml
lib/java/bi-report-service/.idea/workspace.xml
+1
-1
send_email.sh
lib/java/bi-report-service/service-client/shs/send_email.sh
+2
-5
BiReportEndpoint.java
...m/gmei/data/gateway/server/endpoint/BiReportEndpoint.java
+4
-3
BiReportService.java
...com/gmei/data/gateway/server/service/BiReportService.java
+1
-1
BiReportServiceImpl.java
...data/gateway/server/service/impl/BiReportServiceImpl.java
+2
-2
ExcelServiceImpl.java
...ei/data/gateway/server/service/impl/ExcelServiceImpl.java
+2
-1
No files found.
lib/java/bi-report-service/.idea/workspace.xml
View file @
d6930096
...
...
@@ -215,7 +215,7 @@
<workItem
from=
"1584945647680"
duration=
"4469000"
/>
<workItem
from=
"1588148891822"
duration=
"2318000"
/>
<workItem
from=
"1588152718016"
duration=
"1463000"
/>
<workItem
from=
"1588154601852"
duration=
"2
5454
000"
/>
<workItem
from=
"1588154601852"
duration=
"2
6091
000"
/>
</task>
<servers
/>
</component>
...
...
lib/java/bi-report-service/service-client/shs/send_email.sh
View file @
d6930096
#!/usr/bin/env bash
curl
-X
POST
-H
"Content-Type:application/json"
--data
'{"name":"demo","subject":"abc"}'
http://localhost:8553/api/report/sendEmail
curl
-X
GET http://localhost:8553/api/report/sendEmail?name
=
demo&subject
=
123
\ No newline at end of file
curl
-X
GET http://localhost:8553/api/report/sendEmail/demo/test
\ No newline at end of file
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/endpoint/BiReportEndpoint.java
View file @
d6930096
...
...
@@ -18,8 +18,9 @@ public class BiReportEndpoint {
}
@ResponseBody
@RequestMapping
(
value
=
"/sendEmail/{name}/{subject}"
,
method
=
RequestMethod
.
GET
)
public
int
sendEmail
(
@PathVariable
(
"name"
)
String
name
,
@PathVariable
(
"subject"
)
String
subject
){
return
biReportService
.
sendEmail
(
name
,
subject
);
@RequestMapping
(
value
=
"/sendEmail/{to}/{cc}/{name}/{subject}"
,
method
=
RequestMethod
.
GET
)
public
int
sendEmail
(
@PathVariable
(
"to"
)
String
to
,
@PathVariable
(
"cc"
)
String
cc
,
@PathVariable
(
"name"
)
String
name
,
@PathVariable
(
"subject"
)
String
subject
){
return
biReportService
.
sendEmail
(
to
,
cc
,
name
,
subject
);
}
}
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/BiReportService.java
View file @
d6930096
...
...
@@ -2,5 +2,5 @@ package com.gmei.data.gateway.server.service;
public
interface
BiReportService
{
int
genExcel
(
String
name
);
int
sendEmail
(
String
name
,
String
subject
);
int
sendEmail
(
String
to
,
String
cc
,
String
name
,
String
subject
);
}
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/impl/BiReportServiceImpl.java
View file @
d6930096
...
...
@@ -36,12 +36,12 @@ public class BiReportServiceImpl implements BiReportService {
}
@Override
public
int
sendEmail
(
String
name
,
String
subject
){
public
int
sendEmail
(
String
to
,
String
cc
,
String
name
,
String
subject
){
int
rs
=
Constants
.
SUCCESS
;
ExcelGenDto
resultDto
=
sparksqlService
.
getResultDto
(
name
);
int
genExcelRs
=
excelService
.
genExcel
(
resultDto
,
subject
);
if
(
Constants
.
SUCCESS
==
genExcelRs
){
rs
=
emailService
.
sendAttachmentsMail
(
"zhaojianwei@igengmei.com"
,
"jianweizhao@yeah.net"
,
"测试示例"
);
rs
=
emailService
.
sendAttachmentsMail
(
to
,
cc
,
subject
);
}
return
rs
;
}
...
...
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/impl/ExcelServiceImpl.java
View file @
d6930096
...
...
@@ -3,6 +3,7 @@ package com.gmei.data.gateway.server.service.impl;
import
com.gmei.data.gateway.server.common.Constants
;
import
com.gmei.data.gateway.server.dto.ExcelGenDto
;
import
com.gmei.data.gateway.server.service.ExcelService
;
import
com.gmei.data.gateway.server.utils.DateUtils
;
import
org.apache.poi.ss.usermodel.BorderStyle
;
import
org.apache.poi.ss.usermodel.HorizontalAlignment
;
import
org.apache.poi.ss.usermodel.VerticalAlignment
;
...
...
@@ -57,7 +58,7 @@ public class ExcelServiceImpl implements ExcelService {
logger
.
error
(
"Error!"
);
}
try
{
FileOutputStream
out
=
new
FileOutputStream
(
filePath
+
subject
+
".xlsx"
);
FileOutputStream
out
=
new
FileOutputStream
(
filePath
+
subject
+
"-"
+
DateUtils
.
getCurrentDateSimpleStr
()
+
".xlsx"
);
wb
.
write
(
out
);
out
.
close
();
}
catch
(
IOException
e
)
{
...
...
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