Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
change4weixin
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
shenjinzhu
change4weixin
Commits
3a03e176
Commit
3a03e176
authored
May 11, 2018
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部分推送取消
parent
025cc5e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
6 deletions
+23
-6
src/main/java/com/zhiwei/chendong/ExcelReadAndWrite.java
+13
-0
src/main/java/com/zhiwei/chendong/ReaderExcel.java
+6
-3
src/main/java/com/zhiwei/finance/PushFinanceByTime.java
+2
-2
src/main/java/com/zhiwei/finance/PushFinanceByTimeLess.java
+1
-1
src/main/java/com/zhiwei/servlet/MainController.java
+1
-0
No files found.
src/main/java/com/zhiwei/chendong/ExcelReadAndWrite.java
View file @
3a03e176
...
@@ -305,6 +305,19 @@ public class ExcelReadAndWrite {
...
@@ -305,6 +305,19 @@ public class ExcelReadAndWrite {
}
}
public
static
void
main
(
String
[]
args
)
{
try
(
Socket
s
=
new
Socket
(
host
,
port
);
PrintWriter
pw
=
new
PrintWriter
(
s
.
getOutputStream
());
BufferedReader
bufferedReader
=
new
BufferedReader
(
new
InputStreamReader
(
s
.
getInputStream
(),
"utf-8"
));)
{
pw
.
println
(
"getnum"
);
pw
.
flush
();
String
str
=
bufferedReader
.
readLine
();
System
.
out
.
println
(
"正常运行"
+
str
);
}
catch
(
Exception
e
)
{
log
.
error
(
"错误信息{}"
,
e
);
}
}
public
static
byte
[]
readStream
(
InputStream
inStream
)
throws
Exception
{
public
static
byte
[]
readStream
(
InputStream
inStream
)
throws
Exception
{
ByteArrayOutputStream
outSteam
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
outSteam
=
new
ByteArrayOutputStream
();
byte
[]
buffer
=
new
byte
[
1024
];
byte
[]
buffer
=
new
byte
[
1024
];
...
...
src/main/java/com/zhiwei/chendong/ReaderExcel.java
View file @
3a03e176
...
@@ -22,8 +22,10 @@ public class ReaderExcel {
...
@@ -22,8 +22,10 @@ public class ReaderExcel {
private
final
static
Log
log
=
LogFactory
.
getLog
(
ReaderExcel
.
class
);
private
final
static
Log
log
=
LogFactory
.
getLog
(
ReaderExcel
.
class
);
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
System
.
out
.
println
(
"https://mp.weixin.qq.com/s?src=11×tamp=1525385592&ver=855&signature=t61muuTJKorCLU9B6F9khlfr3ezct6GGh-Moxq*9b4RZxgQnHSpElHV9CYCi2YnSA3nOz2*a04k6R9iHOGzctg1KS9Bgx3jelhxEi5NzmXHmhglHbp8Tjf5*rKEFilpi&new=1&key=95dc4253938e3c7ba33e1ff6f7363608ab00e37f99c7f7ff7e7cb4e5b1a6ce70df92e7de80d56d237ffe33cd15ffcb0a80bc0d064ece8d169c6e38960f0d44e359a01cd7bcb987a08b3de1a19e94eb06&uin=NTk1NjM2Nzg3&key=b97b0a94956e0cb2b01167441267dc09f5e79cb852c323792d0040c1988b0c39913e23a2e43b0bccef725d2843e0da0d81c5164338260e6b932f25085936eec21b0e71ca66cd78582d2411b4737cb644&uin=MzM3MTk2NzAxNA%3D%3D"
.
replaceAll
(
"&key=[\\s\\S]+"
,
""
));
System
.
out
.
println
(
"https://mp.weixin.qq.com/s?src=11×tamp=1525385592&ver=855&signature=t61muuTJKorCLU9B6F9khlfr3ezct6GGh-Moxq*9b4RZxgQnHSpElHV9CYCi2YnSA3nOz2*a04k6R9iHOGzctg1KS9Bgx3jelhxEi5NzmXHmhglHbp8Tjf5*rKEFilpi&new=1&key=95dc4253938e3c7ba33e1ff6f7363608ab00e37f99c7f7ff7e7cb4e5b1a6ce70df92e7de80d56d237ffe33cd15ffcb0a80bc0d064ece8d169c6e38960f0d44e359a01cd7bcb987a08b3de1a19e94eb06&uin=NTk1NjM2Nzg3&key=b97b0a94956e0cb2b01167441267dc09f5e79cb852c323792d0040c1988b0c39913e23a2e43b0bccef725d2843e0da0d81c5164338260e6b932f25085936eec21b0e71ca66cd78582d2411b4737cb644&uin=MzM3MTk2NzAxNA%3D%3D"
.
replaceAll
(
"&key=[\\s\\S]+"
,
""
));
}
}
public
static
List
<
Weixin
>
getExcel
(
String
url
)
throws
IOException
{
public
static
List
<
Weixin
>
getExcel
(
String
url
)
throws
IOException
{
...
@@ -101,7 +103,7 @@ public class ReaderExcel {
...
@@ -101,7 +103,7 @@ public class ReaderExcel {
}
}
}
}
}
}
if
(
w
!=
null
)
if
(
w
!=
null
&&
w
.
getUrl
()
!=
null
)
list
.
add
(
w
);
list
.
add
(
w
);
}
}
}
}
...
@@ -140,6 +142,7 @@ public class ReaderExcel {
...
@@ -140,6 +142,7 @@ public class ReaderExcel {
}
}
return
list
;
return
list
;
}
}
public
static
Sheet
getSheetByNum
(
Workbook
book
,
int
number
)
{
public
static
Sheet
getSheetByNum
(
Workbook
book
,
int
number
)
{
Sheet
sheet
=
null
;
Sheet
sheet
=
null
;
try
{
try
{
...
...
src/main/java/com/zhiwei/finance/PushFinanceByTime.java
View file @
3a03e176
...
@@ -107,7 +107,7 @@ public class PushFinanceByTime extends Thread {
...
@@ -107,7 +107,7 @@ public class PushFinanceByTime extends Thread {
}
}
}
}
private
void
sendsEmail
(
Calendar
cal
,
List
<
NewsResult
>
list
,
private
void
sendsEmail
(
Calendar
cal
,
List
<
NewsResult
>
list
,
String
url
)
{
String
url
)
{
try
{
try
{
new
ExcelUtil
().
pushDataWithFinanceLong
(
list
,
cal
.
getTime
(),
url
);
new
ExcelUtil
().
pushDataWithFinanceLong
(
list
,
cal
.
getTime
(),
url
);
...
@@ -118,7 +118,7 @@ public class PushFinanceByTime extends Thread {
...
@@ -118,7 +118,7 @@ public class PushFinanceByTime extends Thread {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"一号邮箱发送失败,尝试二号邮箱{}"
,
e
);
log
.
error
(
"一号邮箱发送失败,尝试二号邮箱{}"
,
e
);
try
{
try
{
new
ExcelUtil
().
pushDataWithFinanceLong
(
list
,
cal
.
getTime
(),
url
);
new
ExcelUtil
().
pushDataWithFinanceLong
(
list
,
cal
.
getTime
(),
url
);
SendMailUtil
.
sendMessage2
(
"949131080@qq.com"
,
url
,
"金融"
);
SendMailUtil
.
sendMessage2
(
"949131080@qq.com"
,
url
,
"金融"
);
SendMailUtil
.
sendMessage2
(
"yuhualong@zhiweidata.com"
,
url
,
"金融"
);
SendMailUtil
.
sendMessage2
(
"yuhualong@zhiweidata.com"
,
url
,
"金融"
);
SendMailUtil
.
sendMessage2
(
"ligaodie@zhiweidata.com"
,
url
,
"金融"
);
SendMailUtil
.
sendMessage2
(
"ligaodie@zhiweidata.com"
,
url
,
"金融"
);
...
...
src/main/java/com/zhiwei/finance/PushFinanceByTimeLess.java
View file @
3a03e176
...
@@ -17,7 +17,7 @@ import com.zw.entity.NewsResult;
...
@@ -17,7 +17,7 @@ import com.zw.entity.NewsResult;
import
sendmail.SendMailUtil
;
import
sendmail.SendMailUtil
;
@Component
//
@Component
public
class
PushFinanceByTimeLess
extends
Thread
{
public
class
PushFinanceByTimeLess
extends
Thread
{
private
static
final
Log
log
=
LogFactory
.
getLog
(
PushFinanceByTimeLess
.
class
);
private
static
final
Log
log
=
LogFactory
.
getLog
(
PushFinanceByTimeLess
.
class
);
private
static
final
MongoConnection
con
=
new
MongoConnection
();
private
static
final
MongoConnection
con
=
new
MongoConnection
();
...
...
src/main/java/com/zhiwei/servlet/MainController.java
View file @
3a03e176
...
@@ -230,6 +230,7 @@ public class MainController {
...
@@ -230,6 +230,7 @@ public class MainController {
excel
.
setSite
(
0
);
excel
.
setSite
(
0
);
excel
.
setSurplusCount
(
list
.
size
());
excel
.
setSurplusCount
(
list
.
size
());
excel
.
setStartDate
(
"未开始"
);
excel
.
setStartDate
(
"未开始"
);
System
.
out
.
println
(
list
.
size
());
lists
.
add
(
excel
);
lists
.
add
(
excel
);
if
(!
ExcelReadAndWrite
.
runStrat
)
{
if
(!
ExcelReadAndWrite
.
runStrat
)
{
Thread
t
=
new
Thread
()
{
Thread
t
=
new
Thread
()
{
...
...
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