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
89888c6c
Commit
89888c6c
authored
May 01, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upadte codes
parent
b4873e4b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
workspace.xml
.idea/workspace.xml
+1
-1
workspace.xml
lib/java/bi-report-service/.idea/workspace.xml
+1
-1
ServiceServerApplication.java
...om/gmei/data/gateway/server/ServiceServerApplication.java
+1
-0
EmailServiceImpl.java
...ei/data/gateway/server/service/impl/EmailServiceImpl.java
+5
-2
No files found.
.idea/workspace.xml
View file @
89888c6c
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
<workItem
from=
"1588154352798"
duration=
"195000"
/>
<workItem
from=
"1588154352798"
duration=
"195000"
/>
<workItem
from=
"1588220085338"
duration=
"7993000"
/>
<workItem
from=
"1588220085338"
duration=
"7993000"
/>
<workItem
from=
"1588248522289"
duration=
"2820000"
/>
<workItem
from=
"1588248522289"
duration=
"2820000"
/>
<workItem
from=
"1588344251422"
duration=
"17
26
000"
/>
<workItem
from=
"1588344251422"
duration=
"17
93
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>
...
...
lib/java/bi-report-service/.idea/workspace.xml
View file @
89888c6c
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
<workItem
from=
"1588148891822"
duration=
"2318000"
/>
<workItem
from=
"1588148891822"
duration=
"2318000"
/>
<workItem
from=
"1588152718016"
duration=
"1463000"
/>
<workItem
from=
"1588152718016"
duration=
"1463000"
/>
<workItem
from=
"1588154601852"
duration=
"28557000"
/>
<workItem
from=
"1588154601852"
duration=
"28557000"
/>
<workItem
from=
"1588344252163"
duration=
"3
149
000"
/>
<workItem
from=
"1588344252163"
duration=
"3
401
000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
...
...
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/ServiceServerApplication.java
View file @
89888c6c
...
@@ -9,6 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
...
@@ -9,6 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@SpringBootApplication
public
class
ServiceServerApplication
{
public
class
ServiceServerApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
setProperty
(
"mail.mime.splitlongparameters"
,
"false"
);
SpringApplication
.
run
(
ServiceServerApplication
.
class
,
args
);
SpringApplication
.
run
(
ServiceServerApplication
.
class
,
args
);
}
}
}
}
lib/java/bi-report-service/service-server/src/main/java/com/gmei/data/gateway/server/service/impl/EmailServiceImpl.java
View file @
89888c6c
...
@@ -15,6 +15,7 @@ import org.springframework.stereotype.Component;
...
@@ -15,6 +15,7 @@ import org.springframework.stereotype.Component;
import
javax.mail.MessagingException
;
import
javax.mail.MessagingException
;
import
javax.mail.internet.MimeMessage
;
import
javax.mail.internet.MimeMessage
;
import
javax.mail.internet.MimeUtility
;
import
java.io.File
;
import
java.io.File
;
...
@@ -48,7 +49,8 @@ public class EmailServiceImpl implements EmailService {
...
@@ -48,7 +49,8 @@ public class EmailServiceImpl implements EmailService {
MimeMessage
message
=
mailSender
.
createMimeMessage
();
MimeMessage
message
=
mailSender
.
createMimeMessage
();
try
{
try
{
MimeMessageHelper
helper
=
new
MimeMessageHelper
(
message
,
true
);
//MimeMessageHelper helper = new MimeMessageHelper(message, true);
MimeMessageHelper
helper
=
new
MimeMessageHelper
(
message
,
true
,
"UTF-8"
);
helper
.
setFrom
(
from
);
helper
.
setFrom
(
from
);
String
[]
toUsers
=
to
.
split
(
","
);
String
[]
toUsers
=
to
.
split
(
","
);
helper
.
setTo
(
toUsers
);
helper
.
setTo
(
toUsers
);
...
@@ -64,9 +66,10 @@ public class EmailServiceImpl implements EmailService {
...
@@ -64,9 +66,10 @@ public class EmailServiceImpl implements EmailService {
String
fileNameSrc
=
name
+
"-"
+
DateUtils
.
getCurrentDateSimpleStr
()
+
".xlsx"
;
String
fileNameSrc
=
name
+
"-"
+
DateUtils
.
getCurrentDateSimpleStr
()
+
".xlsx"
;
FileSystemResource
file
=
new
FileSystemResource
(
new
File
(
filePath
+
fileNameSrc
));
FileSystemResource
file
=
new
FileSystemResource
(
new
File
(
filePath
+
fileNameSrc
));
helper
.
addAttachment
(
fileName
,
file
);
helper
.
addAttachment
(
fileName
,
file
);
helper
.
addAttachment
(
MimeUtility
.
encodeWord
(
file
.
getFilename
(),
"utf-8"
,
"B"
),
file
);
mailSender
.
send
(
message
);
mailSender
.
send
(
message
);
logger
.
info
(
"带附件的邮件已经发送。"
);
logger
.
info
(
"带附件的邮件已经发送。"
);
}
catch
(
Messaging
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送带附件的邮件时发生异常!"
,
e
);
logger
.
error
(
"发送带附件的邮件时发生异常!"
,
e
);
rs
=
Constants
.
FAIL
;
rs
=
Constants
.
FAIL
;
}
}
...
...
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