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
c57b50d9
Commit
c57b50d9
authored
May 24, 2018
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件说明添加
parent
35054b66
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
505 additions
and
156 deletions
+505
-156
src/main/java/com/zhiwei/chendong/ExcelReadAndWrite.java
+70
-4
src/main/java/com/zhiwei/chendong/FileThread.java
+23
-21
src/main/java/com/zhiwei/chendong/MongoForChenDong.java
+19
-7
src/main/java/com/zhiwei/chendong/ReaderExcel.java
+7
-37
src/main/java/com/zhiwei/finance/ESUtil.java
+21
-23
src/main/java/com/zhiwei/finance/PushFinanceByTime.java
+13
-0
src/main/java/com/zhiwei/finance/WeixinSend.java
+13
-5
src/main/java/com/zhiwei/readWechat/Client.java
+6
-0
src/main/java/com/zhiwei/readWechat/ReadExcel.java
+1
-1
src/main/java/com/zhiwei/readWechat/ServerClient.java
+6
-0
src/main/java/com/zhiwei/readWechat/WechatReadAndWrite.java
+6
-0
src/main/java/com/zhiwei/service/Services.java
+6
-5
src/main/java/com/zhiwei/servlet/FianceController.java
+48
-1
src/main/java/com/zhiwei/servlet/MainController.java
+72
-13
src/main/java/com/zhiwei/servlet/RwController.java
+52
-0
src/main/java/com/zhiwei/util/AESUtils.java
+7
-0
src/main/java/com/zhiwei/util/Config.java
+11
-4
src/main/java/com/zhiwei/util/JsonToObject.java
+7
-7
src/main/java/com/zhiwei/util/MongoConnection.java
+19
-8
src/main/java/com/zhiwei/util/ReadWechatConnect.java
+6
-0
src/main/java/com/zhiwei/util/StringUtil.java
+7
-1
src/main/java/com/zw/entity/ExcelFile.java
+15
-10
src/main/java/com/zw/entity/Excels.java
+22
-1
src/main/java/com/zw/entity/ReadWechat.java
+6
-0
src/main/java/com/zw/entity/Weixin.java
+41
-5
src/main/java/sendmail/SendMailUtil.java
+1
-3
No files found.
src/main/java/com/zhiwei/chendong/ExcelReadAndWrite.java
View file @
c57b50d9
...
@@ -52,6 +52,12 @@ public class ExcelReadAndWrite {
...
@@ -52,6 +52,12 @@ public class ExcelReadAndWrite {
public
static
int
port
=
Integer
.
valueOf
(
Config
.
getVal
(
"socketPort"
));
public
static
int
port
=
Integer
.
valueOf
(
Config
.
getVal
(
"socketPort"
));
private
static
MongoForChenDong
m
=
new
MongoForChenDong
();
private
static
MongoForChenDong
m
=
new
MongoForChenDong
();
/**
* 读取微信转链接的文件
*
* @param url
* @return
*/
public
static
List
<
Weixin
>
readExcels
(
String
url
)
{
public
static
List
<
Weixin
>
readExcels
(
String
url
)
{
InputStream
stream
=
null
;
InputStream
stream
=
null
;
String
str
=
null
;
String
str
=
null
;
...
@@ -127,6 +133,13 @@ public class ExcelReadAndWrite {
...
@@ -127,6 +133,13 @@ public class ExcelReadAndWrite {
return
list
;
return
list
;
}
}
/**
* 写出转链接的文件
*
* @param list
* @param mail
* @throws Exception
*/
public
static
void
write
(
List
<
Weixin
>
list
,
String
mail
)
throws
Exception
{
public
static
void
write
(
List
<
Weixin
>
list
,
String
mail
)
throws
Exception
{
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
...
@@ -191,7 +204,15 @@ public class ExcelReadAndWrite {
...
@@ -191,7 +204,15 @@ public class ExcelReadAndWrite {
System
.
out
.
println
(
"发送完成"
);
System
.
out
.
println
(
"发送完成"
);
}
}
public
static
void
write2222
(
List
<
Weixin
>
list
)
throws
IOException
,
RowsExceededException
,
WriteException
{
/**
* 写出转链接的文件
*
* @param list
* @throws IOException
* @throws RowsExceededException
* @throws WriteException
*/
public
static
void
write
(
List
<
Weixin
>
list
)
throws
Exception
{
File
tempFile
=
new
File
(
url
);
File
tempFile
=
new
File
(
url
);
if
(!
tempFile
.
exists
())
{
if
(!
tempFile
.
exists
())
{
tempFile
.
createNewFile
();
tempFile
.
createNewFile
();
...
@@ -289,6 +310,13 @@ public class ExcelReadAndWrite {
...
@@ -289,6 +310,13 @@ public class ExcelReadAndWrite {
}
}
}
}
/**
* 将输入流转换成byte[]
*
* @param inStream
* @return
* @throws Exception
*/
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
];
...
@@ -301,6 +329,11 @@ public class ExcelReadAndWrite {
...
@@ -301,6 +329,11 @@ public class ExcelReadAndWrite {
return
outSteam
.
toByteArray
();
return
outSteam
.
toByteArray
();
}
}
/**
* socket通信正常执行部分
*
* @return
*/
public
static
boolean
so
()
{
public
static
boolean
so
()
{
boolean
b
=
true
;
boolean
b
=
true
;
int
tip
=
0
;
int
tip
=
0
;
...
@@ -345,6 +378,11 @@ public class ExcelReadAndWrite {
...
@@ -345,6 +378,11 @@ public class ExcelReadAndWrite {
return
b
;
return
b
;
}
}
/**
* 插队部分socket通信执行
*
* @return
*/
public
static
boolean
cutso
()
{
public
static
boolean
cutso
()
{
boolean
b
=
true
;
boolean
b
=
true
;
try
(
Socket
s
=
new
Socket
(
host
,
port
);
try
(
Socket
s
=
new
Socket
(
host
,
port
);
...
@@ -405,7 +443,7 @@ public class ExcelReadAndWrite {
...
@@ -405,7 +443,7 @@ public class ExcelReadAndWrite {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
try
{
try
{
save
();
doChangeUrlWithCut
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -442,7 +480,7 @@ public class ExcelReadAndWrite {
...
@@ -442,7 +480,7 @@ public class ExcelReadAndWrite {
*
*
* @throws Exception
* @throws Exception
*/
*/
public
static
void
save
()
throws
Exception
{
public
static
void
doChangeUrlWithCut
()
throws
Exception
{
System
.
out
.
println
(
"插队开始处理"
);
System
.
out
.
println
(
"插队开始处理"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Excels
excel
=
MainController
.
excel
;
Excels
excel
=
MainController
.
excel
;
...
@@ -494,7 +532,7 @@ public class ExcelReadAndWrite {
...
@@ -494,7 +532,7 @@ public class ExcelReadAndWrite {
*
*
* @throws Exception
* @throws Exception
*/
*/
public
synchronized
static
void
save2
()
throws
Exception
{
public
synchronized
static
void
doChangeUrl
()
throws
Exception
{
runStrat
=
true
;
runStrat
=
true
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
while
(
true
)
{
while
(
true
)
{
...
@@ -587,19 +625,41 @@ public class ExcelReadAndWrite {
...
@@ -587,19 +625,41 @@ public class ExcelReadAndWrite {
log
.
info
(
"删除完成"
);
log
.
info
(
"删除完成"
);
}
}
/**
* 转链接结束文件信息存入数据库
*
* @param ef
*/
public
static
void
insert
(
ExcelFile
ef
)
{
public
static
void
insert
(
ExcelFile
ef
)
{
m
.
insertFile
(
ef
);
m
.
insertFile
(
ef
);
}
}
/**
* 查询所有转链接的文件
*
* @return
*/
public
static
List
<
ExcelFile
>
findEf
()
{
public
static
List
<
ExcelFile
>
findEf
()
{
List
<
ExcelFile
>
list
=
m
.
findFile
();
List
<
ExcelFile
>
list
=
m
.
findFile
();
return
list
;
return
list
;
}
}
/**
* 根据文件id去查询文件
*
* @param id
* @return
*/
public
static
String
findById
(
String
id
)
{
public
static
String
findById
(
String
id
)
{
return
m
.
findByid
(
id
);
return
m
.
findByid
(
id
);
}
}
/**
* 读取excel
*
* @param url
* @return
*/
public
static
List
<
String
>
readExcel
(
String
url
)
{
public
static
List
<
String
>
readExcel
(
String
url
)
{
InputStream
stream
=
null
;
InputStream
stream
=
null
;
String
str
=
null
;
String
str
=
null
;
...
@@ -625,6 +685,12 @@ public class ExcelReadAndWrite {
...
@@ -625,6 +685,12 @@ public class ExcelReadAndWrite {
return
list
;
return
list
;
}
}
/**
* 链接重定向
*
* @param url
* @return
*/
public
static
String
urlRedirect
(
String
url
)
{
public
static
String
urlRedirect
(
String
url
)
{
String
result
=
null
;
String
result
=
null
;
try
{
try
{
...
...
src/main/java/com/zhiwei/chendong/FileThread.java
View file @
c57b50d9
...
@@ -12,28 +12,35 @@ import org.springframework.stereotype.Component;
...
@@ -12,28 +12,35 @@ import org.springframework.stereotype.Component;
import
com.zw.entity.ExcelFile
;
import
com.zw.entity.ExcelFile
;
/**
* 文件定期清除线程
*
* @author admin
*
*/
@Component
@Component
public
class
FileThread
extends
Thread
{
public
class
FileThread
extends
Thread
{
private
static
final
Log
log
=
LogFactory
.
getLog
(
FileThread
.
class
);
private
static
final
Log
log
=
LogFactory
.
getLog
(
FileThread
.
class
);
private
static
MongoForChenDong
m
=
new
MongoForChenDong
();
private
static
MongoForChenDong
m
=
new
MongoForChenDong
();
public
FileThread
(){
public
FileThread
()
{
this
.
start
();
this
.
start
();
}
}
public
void
run
(){
@Override
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
public
void
run
()
{
while
(
true
){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
while
(
true
)
{
System
.
out
.
println
(
"执行"
);
System
.
out
.
println
(
"执行"
);
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
if
(
c
.
get
(
Calendar
.
HOUR_OF_DAY
)==
1
)
{
if
(
c
.
get
(
Calendar
.
HOUR_OF_DAY
)
==
1
)
{
c
.
add
(
Calendar
.
DATE
,
-
7
);
c
.
add
(
Calendar
.
DATE
,
-
7
);
List
<
String
>
removeList
=
new
ArrayList
<
String
>();
List
<
String
>
removeList
=
new
ArrayList
<
String
>();
List
<
ExcelFile
>
list
=
m
.
findFile
();
List
<
ExcelFile
>
list
=
m
.
findFile
();
for
(
ExcelFile
ex:
list
)
{
for
(
ExcelFile
ex
:
list
)
{
try
{
try
{
if
(
sdf
.
parse
(
ex
.
getDate
()).
before
(
c
.
getTime
()))
{
if
(
sdf
.
parse
(
ex
.
getDate
()).
before
(
c
.
getTime
()))
{
removeList
.
add
(
ex
.
getId
());
removeList
.
add
(
ex
.
getId
());
ExcelReadAndWrite
.
delete
(
ex
.
getUrl
());
ExcelReadAndWrite
.
delete
(
ex
.
getUrl
());
}
}
...
@@ -41,25 +48,20 @@ public class FileThread extends Thread{
...
@@ -41,25 +48,20 @@ public class FileThread extends Thread{
log
.
info
(
"时间格式转换出错{FileThread.39}"
);
log
.
info
(
"时间格式转换出错{FileThread.39}"
);
}
}
}
}
for
(
String
url:
removeList
)
{
for
(
String
url
:
removeList
)
{
m
.
delete
(
url
);
m
.
delete
(
url
);
}
}
try
{
try
{
Thread
.
sleep
(
1000
*
3600
);
Thread
.
sleep
(
1000
*
3600
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
try
{
try
{
Thread
.
sleep
(
1000
*
3500
);
Thread
.
sleep
(
1000
*
3500
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
// try {
// Thread.sleep(1000*60*30);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
}
}
}
}
}
}
src/main/java/com/zhiwei/chendong/MongoForChenDong.java
View file @
c57b50d9
...
@@ -37,19 +37,12 @@ public class MongoForChenDong {
...
@@ -37,19 +37,12 @@ public class MongoForChenDong {
optionsBuilder
.
connectTimeout
(
1000
*
60
*
40
);
// 与数据库建立连接的超时时间
optionsBuilder
.
connectTimeout
(
1000
*
60
*
40
);
// 与数据库建立连接的超时时间
optionsBuilder
.
maxWaitTime
(
1000
*
60
*
5
);
// 一个线程成功获取到一个可用数据库连接之前的最大等待时间
optionsBuilder
.
maxWaitTime
(
1000
*
60
*
5
);
// 一个线程成功获取到一个可用数据库连接之前的最大等待时间
optionsBuilder
.
threadsAllowedToBlockForConnectionMultiplier
(
100
);
// 等待一个连接
optionsBuilder
.
threadsAllowedToBlockForConnectionMultiplier
(
100
);
// 等待一个连接
// //
// 允许阻塞的线程数
optionsBuilder
.
maxConnectionIdleTime
(
0
);
optionsBuilder
.
maxConnectionIdleTime
(
0
);
optionsBuilder
.
maxConnectionLifeTime
(
0
);
optionsBuilder
.
maxConnectionLifeTime
(
0
);
optionsBuilder
.
socketKeepAlive
(
true
);
optionsBuilder
.
socketKeepAlive
(
true
);
optionsBuilder
.
socketTimeout
(
1000
*
20
);
optionsBuilder
.
socketTimeout
(
1000
*
20
);
MongoClientOptions
options
=
optionsBuilder
.
build
();
MongoClientOptions
options
=
optionsBuilder
.
build
();
// char[] passwords = Config.getVal("password").toCharArray();
List
<
MongoCredential
>
credentials
=
new
ArrayList
<>();
List
<
MongoCredential
>
credentials
=
new
ArrayList
<>();
// MongoCredential credential =
// MongoCredential.createCredential(Config.getVal("user"),
// Config.getVal("dbName"), passwords);
// credentials.add(credential);
List
<
ServerAddress
>
serverAddresses
=
new
ArrayList
<>();
List
<
ServerAddress
>
serverAddresses
=
new
ArrayList
<>();
serverAddresses
.
add
(
new
ServerAddress
(
Config
.
getVal
(
"host"
),
Integer
.
valueOf
(
Config
.
getVal
(
"port"
))));
serverAddresses
.
add
(
new
ServerAddress
(
Config
.
getVal
(
"host"
),
Integer
.
valueOf
(
Config
.
getVal
(
"port"
))));
mongoClient
=
new
MongoClient
(
serverAddresses
,
credentials
,
options
);
mongoClient
=
new
MongoClient
(
serverAddresses
,
credentials
,
options
);
...
@@ -104,6 +97,11 @@ public class MongoForChenDong {
...
@@ -104,6 +97,11 @@ public class MongoForChenDong {
}
}
}
}
/**
* 获取数量
*
* @return
*/
public
int
getNum
()
{
public
int
getNum
()
{
DB
db
=
mongoClient
.
getDB
(
Config
.
getVal
(
"dbName"
));
DB
db
=
mongoClient
.
getDB
(
Config
.
getVal
(
"dbName"
));
DBCollection
dbCollection
=
db
.
getCollection
(
"RawUrl"
);
DBCollection
dbCollection
=
db
.
getCollection
(
"RawUrl"
);
...
@@ -115,6 +113,9 @@ public class MongoForChenDong {
...
@@ -115,6 +113,9 @@ public class MongoForChenDong {
return
list
.
size
();
return
list
.
size
();
}
}
/**
* 删除结果集的表
*/
public
void
remove
()
{
public
void
remove
()
{
DB
db
=
mongoClient
.
getDB
(
Config
.
getVal
(
"dbName"
));
DB
db
=
mongoClient
.
getDB
(
Config
.
getVal
(
"dbName"
));
DBCollection
dbCollection
=
db
.
getCollection
(
"Result"
);
DBCollection
dbCollection
=
db
.
getCollection
(
"Result"
);
...
@@ -159,12 +160,23 @@ public class MongoForChenDong {
...
@@ -159,12 +160,23 @@ public class MongoForChenDong {
return
list
;
return
list
;
}
}
/**
* 删除保存期限已经过的文件
*
* @param id
*/
public
void
delete
(
String
id
)
{
public
void
delete
(
String
id
)
{
DB
db
=
mongoClient
.
getDB
(
Config
.
getVal
(
"dbName"
));
DB
db
=
mongoClient
.
getDB
(
Config
.
getVal
(
"dbName"
));
DBCollection
dbCollection
=
db
.
getCollection
(
"changeUrlFile"
);
DBCollection
dbCollection
=
db
.
getCollection
(
"changeUrlFile"
);
dbCollection
.
remove
(
new
BasicDBObject
(
"_id"
,
new
ObjectId
(
id
)));
dbCollection
.
remove
(
new
BasicDBObject
(
"_id"
,
new
ObjectId
(
id
)));
}
}
/**
* 根据id查询文件
*
* @param id
* @return
*/
public
String
findByid
(
String
id
)
{
public
String
findByid
(
String
id
)
{
DB
db
=
mongoClient
.
getDB
(
Config
.
getVal
(
"dbName"
));
DB
db
=
mongoClient
.
getDB
(
Config
.
getVal
(
"dbName"
));
DBCollection
dbCollection
=
db
.
getCollection
(
"changeUrlFile"
);
DBCollection
dbCollection
=
db
.
getCollection
(
"changeUrlFile"
);
...
...
src/main/java/com/zhiwei/chendong/ReaderExcel.java
View file @
c57b50d9
...
@@ -19,10 +19,13 @@ import com.zw.entity.Weixin;
...
@@ -19,10 +19,13 @@ import com.zw.entity.Weixin;
public
class
ReaderExcel
{
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
{
/**
* 根据路径读取excel,微信类
}
*
* @param url
* @return
* @throws IOException
*/
public
static
List
<
Weixin
>
getExcel
(
String
url
)
throws
IOException
{
public
static
List
<
Weixin
>
getExcel
(
String
url
)
throws
IOException
{
// String url="C:/Users/Administrator/Desktop/jd.xls";
// String url="C:/Users/Administrator/Desktop/jd.xls";
List
<
Weixin
>
list
=
new
ArrayList
<>();
List
<
Weixin
>
list
=
new
ArrayList
<>();
...
@@ -105,39 +108,6 @@ public class ReaderExcel {
...
@@ -105,39 +108,6 @@ public class ReaderExcel {
return
list
;
return
list
;
}
}
public
static
List
<
String
>
getZhUrls
(
String
url
)
throws
IOException
{
List
<
String
>
list
=
new
ArrayList
<>();
Workbook
book
=
null
;
book
=
getExcelWorkbook
(
url
);
Sheet
sheet
=
getSheetByNum
(
book
,
0
);
int
lastRowNum
=
sheet
.
getLastRowNum
();
log
.
info
(
"last number is "
+
lastRowNum
);
for
(
int
i
=
1
;
i
<=
lastRowNum
;
i
++)
{
Row
row
=
null
;
row
=
sheet
.
getRow
(
i
);
if
(
row
!=
null
)
{
int
lastCellNum
=
row
.
getLastCellNum
();
Cell
cell
=
null
;
for
(
int
j
=
0
;
j
<
lastCellNum
;
j
++)
{
cell
=
row
.
getCell
(
j
);
if
(
cell
!=
null
)
{
cell
.
setCellType
(
Cell
.
CELL_TYPE_STRING
);
String
str
=
cell
.
getStringCellValue
();
if
(
str
!=
null
)
{
if
(
sheet
.
getRow
(
0
).
getCell
(
j
)
==
null
)
{
continue
;
}
if
(
sheet
.
getRow
(
0
).
getCell
(
j
).
getStringCellValue
().
equals
(
"链接"
))
{
list
.
add
(
str
);
}
}
}
}
}
}
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/ESUtil.java
View file @
c57b50d9
...
@@ -73,6 +73,27 @@ public class ESUtil {
...
@@ -73,6 +73,27 @@ public class ESUtil {
return
result
;
return
result
;
}
}
public
static
void
main
(
String
[]
args
)
{
Client
esClient
=
ESClient
.
getInstance
();
SearchRequestBuilder
srb
=
esClient
.
prepareSearch
(
"mediaspider*"
);
BoolQueryBuilder
bb
=
new
BoolQueryBuilder
();
// if (type.equals("weibo")) {
// QueryBuilder matchQuery = QueryBuilders.termQuery("messages", key);
// bb.should(matchQuery);
// srb.setQuery(bb);
// } else {
QueryBuilder
matchQuery
=
QueryBuilders
.
termQuery
(
"title"
,
"王者荣耀:看老外是如何玩王者荣耀的?"
);
bb
.
should
(
matchQuery
);
srb
.
setQuery
(
bb
);
// }
srb
.
setSize
(
1
);
SearchResponse
response
=
srb
.
execute
().
actionGet
();
SearchHits
searchHits
=
response
.
getHits
();
for
(
SearchHit
hit
:
searchHits
.
getHits
())
{
System
.
out
.
println
(
hit
.
getSource
().
get
(
"title"
));
}
}
/**
/**
* 推送
* 推送
*
*
...
@@ -111,18 +132,11 @@ public class ESUtil {
...
@@ -111,18 +132,11 @@ public class ESUtil {
keys
=
new
ReadExcel
().
getExcel
(
path
);
keys
=
new
ReadExcel
().
getExcel
(
path
);
try
{
try
{
for
(
String
key
:
keys
)
{
for
(
String
key
:
keys
)
{
// 搜索数据
SearchRequestBuilder
srb
=
esClient
.
prepareSearch
(
Config
.
getVal
(
"indexName."
+
type
));
SearchRequestBuilder
srb
=
esClient
.
prepareSearch
(
Config
.
getVal
(
"indexName."
+
type
));
BoolQueryBuilder
bb
=
new
BoolQueryBuilder
();
BoolQueryBuilder
bb
=
new
BoolQueryBuilder
();
// if (type.equals("weibo")) {
// QueryBuilder matchQuery = QueryBuilders.termQuery("messages", key);
// bb.should(matchQuery);
// srb.setQuery(bb);
// } else {
QueryBuilder
matchQuery
=
QueryBuilders
.
termQuery
(
"content"
,
key
);
QueryBuilder
matchQuery
=
QueryBuilders
.
termQuery
(
"content"
,
key
);
bb
.
should
(
matchQuery
);
bb
.
should
(
matchQuery
);
srb
.
setQuery
(
bb
);
srb
.
setQuery
(
bb
);
// }
srb
.
setPostFilter
(
QueryBuilders
.
rangeQuery
(
"time"
)
srb
.
setPostFilter
(
QueryBuilders
.
rangeQuery
(
"time"
)
.
gte
(
sdf
.
format
(
startTime
.
getTime
())
+
"T"
+
(
startHour
>
10
?
startHour
:
"0"
+
startHour
)
.
gte
(
sdf
.
format
(
startTime
.
getTime
())
+
"T"
+
(
startHour
>
10
?
startHour
:
"0"
+
startHour
)
+
":00:00.000Z"
)
+
":00:00.000Z"
)
...
@@ -140,21 +154,6 @@ public class ESUtil {
...
@@ -140,21 +154,6 @@ public class ESUtil {
if
(!
url
.
contains
(
"http"
))
{
if
(!
url
.
contains
(
"http"
))
{
url
=
String
.
valueOf
(
map
.
get
(
"id"
));
url
=
String
.
valueOf
(
map
.
get
(
"id"
));
}
}
// if (type.equals("weibo")) {
// n.setUrl(url);
// if (map.get("roottext") == null) {
// n.setTitle(String.valueOf(map.get("text")));
// } else {
// n.setTitle(String.valueOf(map.get("roottext")));
// }
// try {
// n.setTime(map.get("time") + "");
// } catch (Exception e) {
// n.setTime("");
// }
// n.setSource(String.valueOf(map.get("username")));
// result.add(n);
// } else {
n
.
setUrl
(
url
);
n
.
setUrl
(
url
);
n
.
setTitle
(
String
.
valueOf
(
map
.
get
(
"title"
)));
n
.
setTitle
(
String
.
valueOf
(
map
.
get
(
"title"
)));
try
{
try
{
...
@@ -165,7 +164,6 @@ public class ESUtil {
...
@@ -165,7 +164,6 @@ public class ESUtil {
}
}
n
.
setSource
(
String
.
valueOf
(
map
.
get
(
"source"
)));
n
.
setSource
(
String
.
valueOf
(
map
.
get
(
"source"
)));
result
.
add
(
n
);
result
.
add
(
n
);
// }
}
}
}
}
log
.
info
(
"金融结束"
);
log
.
info
(
"金融结束"
);
...
...
src/main/java/com/zhiwei/finance/PushFinanceByTime.java
View file @
c57b50d9
...
@@ -18,6 +18,12 @@ import com.zw.entity.NewsResult;
...
@@ -18,6 +18,12 @@ import com.zw.entity.NewsResult;
import
sendmail.SendMailUtil
;
import
sendmail.SendMailUtil
;
/**
* 金融推送执行的线程
*
* @author admin
*
*/
@Component
@Component
public
class
PushFinanceByTime
extends
Thread
{
public
class
PushFinanceByTime
extends
Thread
{
...
@@ -85,6 +91,13 @@ public class PushFinanceByTime extends Thread {
...
@@ -85,6 +91,13 @@ public class PushFinanceByTime extends Thread {
}
}
}
}
/**
* 邮件发送
*
* @param cal
* @param list
* @param url
*/
private
void
sendsEmail
(
Calendar
cal
,
List
<
NewsResult
>
list
,
String
url
)
{
private
void
sendsEmail
(
Calendar
cal
,
List
<
NewsResult
>
list
,
String
url
)
{
try
{
try
{
new
ExcelUtil
().
pushDataWithFinanceLong
(
list
,
cal
.
getTime
(),
url
);
new
ExcelUtil
().
pushDataWithFinanceLong
(
list
,
cal
.
getTime
(),
url
);
...
...
src/main/java/com/zhiwei/finance/WeixinSend.java
View file @
c57b50d9
package
com
.
zhiwei
.
finance
;
package
com
.
zhiwei
.
finance
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.io.PrintStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.net.URLConnection
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
net.sf.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -19,6 +17,7 @@ import com.zhiwei.util.JsonToObject;
...
@@ -19,6 +17,7 @@ import com.zhiwei.util.JsonToObject;
import
com.zw.entity.NewsResult
;
import
com.zw.entity.NewsResult
;
import
com.zw.entity.UserInfo
;
import
com.zw.entity.UserInfo
;
import
net.sf.json.JSONObject
;
import
weixin.popular.api.MessageAPI
;
import
weixin.popular.api.MessageAPI
;
import
weixin.popular.api.TokenAPI
;
import
weixin.popular.api.TokenAPI
;
import
weixin.popular.api.UserAPI
;
import
weixin.popular.api.UserAPI
;
...
@@ -28,6 +27,12 @@ import weixin.popular.bean.message.templatemessage.TemplateMessageResult;
...
@@ -28,6 +27,12 @@ import weixin.popular.bean.message.templatemessage.TemplateMessageResult;
import
weixin.popular.bean.token.Token
;
import
weixin.popular.bean.token.Token
;
import
weixin.popular.bean.user.Group
;
import
weixin.popular.bean.user.Group
;
/**
* 微信推送
*
* @author admin
*
*/
public
class
WeixinSend
{
public
class
WeixinSend
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
WeixinSend
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
WeixinSend
.
class
);
private
static
Token
token
;
private
static
Token
token
;
...
@@ -43,7 +48,8 @@ public class WeixinSend {
...
@@ -43,7 +48,8 @@ public class WeixinSend {
templateMessage
.
setTemplate_id
(
temp_id
);
templateMessage
.
setTemplate_id
(
temp_id
);
templateMessage
.
setUrl
(
news
.
getUrl
());
templateMessage
.
setUrl
(
news
.
getUrl
());
LinkedHashMap
<
String
,
TemplateMessageItem
>
datamap
=
new
LinkedHashMap
<>();
LinkedHashMap
<
String
,
TemplateMessageItem
>
datamap
=
new
LinkedHashMap
<>();
datamap
.
put
(
"first"
,
new
TemplateMessageItem
(
news
.
getTime
()+
"|"
+
news
.
getSource
()+
"|"
+
"关联:"
+
news
.
getShortName
(),
"RED"
));
datamap
.
put
(
"first"
,
new
TemplateMessageItem
(
news
.
getTime
()
+
"|"
+
news
.
getSource
()
+
"|"
+
"关联:"
+
news
.
getShortName
(),
"RED"
));
datamap
.
put
(
"keyword1"
,
new
TemplateMessageItem
(
" 标题:"
+
news
.
getTitle
(),
null
));
datamap
.
put
(
"keyword1"
,
new
TemplateMessageItem
(
" 标题:"
+
news
.
getTitle
(),
null
));
datamap
.
put
(
"keyword2"
,
new
TemplateMessageItem
(
news
.
getContent
(),
null
));
datamap
.
put
(
"keyword2"
,
new
TemplateMessageItem
(
news
.
getContent
(),
null
));
templateMessage
.
setTouser
(
openid
);
templateMessage
.
setTouser
(
openid
);
...
@@ -68,7 +74,9 @@ public class WeixinSend {
...
@@ -68,7 +74,9 @@ public class WeixinSend {
LinkedHashMap
<
String
,
TemplateMessageItem
>
datamap
=
new
LinkedHashMap
<>();
LinkedHashMap
<
String
,
TemplateMessageItem
>
datamap
=
new
LinkedHashMap
<>();
datamap
.
put
(
"first"
,
new
TemplateMessageItem
(
""
,
null
));
datamap
.
put
(
"first"
,
new
TemplateMessageItem
(
""
,
null
));
datamap
.
put
(
"keyword1"
,
new
TemplateMessageItem
(
" 标题:"
+
news
.
getTitle
(),
null
));
datamap
.
put
(
"keyword1"
,
new
TemplateMessageItem
(
" 标题:"
+
news
.
getTitle
(),
null
));
datamap
.
put
(
"keyword2"
,
new
TemplateMessageItem
(
news
.
getContent
()
+
"\n"
+
news
.
getTime
()+
"|"
+
news
.
getSource
()+
"|"
+
"关联:"
+
news
.
getShortName
(),
null
));
datamap
.
put
(
"keyword2"
,
new
TemplateMessageItem
(
news
.
getContent
()
+
"\n"
+
news
.
getTime
()
+
"|"
+
news
.
getSource
()
+
"|"
+
"关联:"
+
news
.
getShortName
(),
null
));
templateMessage
.
setTouser
(
openid
);
templateMessage
.
setTouser
(
openid
);
templateMessage
.
setData
(
datamap
);
templateMessage
.
setData
(
datamap
);
TemplateMessageResult
result
=
MessageAPI
.
messageTemplateSend
(
access_token
,
templateMessage
);
TemplateMessageResult
result
=
MessageAPI
.
messageTemplateSend
(
access_token
,
templateMessage
);
...
...
src/main/java/com/zhiwei/readWechat/Client.java
View file @
c57b50d9
...
@@ -6,6 +6,12 @@ import java.io.InputStreamReader;
...
@@ -6,6 +6,12 @@ import java.io.InputStreamReader;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
java.net.Socket
;
import
java.net.Socket
;
/**
* 客户端
*
* @author admin
*
*/
public
class
Client
{
public
class
Client
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
...
...
src/main/java/com/zhiwei/readWechat/ReadExcel.java
View file @
c57b50d9
...
@@ -18,7 +18,7 @@ import org.apache.poi.ss.usermodel.WorkbookFactory;
...
@@ -18,7 +18,7 @@ import org.apache.poi.ss.usermodel.WorkbookFactory;
import
com.zw.entity.ReadWechat
;
import
com.zw.entity.ReadWechat
;
/**
/**
* 获取地址输入
* 获取地址输入
excel
*
*
* @author Administrator
* @author Administrator
*
*
...
...
src/main/java/com/zhiwei/readWechat/ServerClient.java
View file @
c57b50d9
...
@@ -11,6 +11,12 @@ import org.apache.commons.logging.Log;
...
@@ -11,6 +11,12 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
/**
* 服务端启动
*
* @author admin
*
*/
@Component
@Component
public
class
ServerClient
extends
Thread
{
public
class
ServerClient
extends
Thread
{
...
...
src/main/java/com/zhiwei/readWechat/WechatReadAndWrite.java
View file @
c57b50d9
...
@@ -31,6 +31,12 @@ import jxl.write.WritableSheet;
...
@@ -31,6 +31,12 @@ import jxl.write.WritableSheet;
import
jxl.write.WritableWorkbook
;
import
jxl.write.WritableWorkbook
;
import
sendmail.SendMailUtil
;
import
sendmail.SendMailUtil
;
/**
* 点赞阅读执行类
*
* @author admin
*
*/
public
class
WechatReadAndWrite
{
public
class
WechatReadAndWrite
{
private
final
static
Log
log
=
LogFactory
.
getLog
(
WechatReadAndWrite
.
class
);
private
final
static
Log
log
=
LogFactory
.
getLog
(
WechatReadAndWrite
.
class
);
public
static
Excels
e
;
public
static
Excels
e
;
...
...
src/main/java/com/zhiwei/service/Services.java
View file @
c57b50d9
...
@@ -9,6 +9,12 @@ import org.springframework.stereotype.Service;
...
@@ -9,6 +9,12 @@ import org.springframework.stereotype.Service;
import
com.zhiwei.util.MongoConnection
;
import
com.zhiwei.util.MongoConnection
;
import
com.zw.entity.ExcelsUrl
;
import
com.zw.entity.ExcelsUrl
;
/**
* 文件更新service
*
* @author admin
*
*/
@Service
@Service
public
class
Services
{
public
class
Services
{
...
@@ -22,11 +28,6 @@ public class Services {
...
@@ -22,11 +28,6 @@ public class Services {
eUrl
.
setType
(
doc
.
getString
(
"type"
));
eUrl
.
setType
(
doc
.
getString
(
"type"
));
eUrl
.
setName
(
doc
.
getString
(
"name"
));
eUrl
.
setName
(
doc
.
getString
(
"name"
));
eUrl
.
setUrl
(
doc
.
getString
(
"url"
));
eUrl
.
setUrl
(
doc
.
getString
(
"url"
));
// switch (doc.getString("name")) {
// case "key":eUrl.setGo("http://192.168.0.245:8080/change4weixin/finance/upExcel");;
// case "longSource":eUrl.setGo("http://192.168.0.245:8080/change4weixin/finance/upExcel");
// case "lessSource":eUrl.setGo("http://192.168.0.245:8080/change4weixin/finance/upExcel");
// }
result
.
add
(
eUrl
);
result
.
add
(
eUrl
);
}
}
return
result
;
return
result
;
...
...
src/main/java/com/zhiwei/servlet/FianceController.java
View file @
c57b50d9
...
@@ -17,10 +17,15 @@ import com.alibaba.fastjson.JSON;
...
@@ -17,10 +17,15 @@ import com.alibaba.fastjson.JSON;
import
com.zhiwei.service.Services
;
import
com.zhiwei.service.Services
;
import
com.zhiwei.util.Config
;
import
com.zhiwei.util.Config
;
import
com.zhiwei.util.ExcelUtil
;
import
com.zhiwei.util.ExcelUtil
;
import
com.zhiwei.util.ReadExcel
;
import
com.zhiwei.util.StringUtil
;
import
com.zhiwei.util.StringUtil
;
import
com.zw.entity.ExcelsUrl
;
import
com.zw.entity.ExcelsUrl
;
/**
* 文件更新控制器
*
* @author admin
*
*/
@Controller
@Controller
@RequestMapping
(
"/finance"
)
@RequestMapping
(
"/finance"
)
public
class
FianceController
{
public
class
FianceController
{
...
@@ -36,6 +41,12 @@ public class FianceController {
...
@@ -36,6 +41,12 @@ public class FianceController {
return
"showfinance"
;
return
"showfinance"
;
}
}
/**
* 金融需要的文件存储
*
* @param file
* @return
*/
public
void
fileSave
(
MultipartFile
file
,
String
path
)
{
public
void
fileSave
(
MultipartFile
file
,
String
path
)
{
File
targetFile
=
new
File
(
path
);
File
targetFile
=
new
File
(
path
);
if
(!
targetFile
.
exists
())
{
if
(!
targetFile
.
exists
())
{
...
@@ -49,6 +60,12 @@ public class FianceController {
...
@@ -49,6 +60,12 @@ public class FianceController {
}
}
}
}
/**
* 更新金融需要的金融关键词文件
*
* @param file
* @return
*/
@RequestMapping
(
value
=
"/upFinanceKey"
)
@RequestMapping
(
value
=
"/upFinanceKey"
)
public
String
upFinanceKey
(
MultipartFile
file
)
{
public
String
upFinanceKey
(
MultipartFile
file
)
{
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
...
@@ -71,6 +88,12 @@ public class FianceController {
...
@@ -71,6 +88,12 @@ public class FianceController {
return
"showfinance"
;
return
"showfinance"
;
}
}
/**
* 更新金融需要的长来源文件
*
* @param file
* @return
*/
@RequestMapping
(
value
=
"/upFinanceLong"
)
@RequestMapping
(
value
=
"/upFinanceLong"
)
public
String
upFinanceLong
(
MultipartFile
file
)
{
public
String
upFinanceLong
(
MultipartFile
file
)
{
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
...
@@ -93,6 +116,12 @@ public class FianceController {
...
@@ -93,6 +116,12 @@ public class FianceController {
return
"showfinance"
;
return
"showfinance"
;
}
}
/**
* 更新金融需要的微信文件
*
* @param file
* @return
*/
@RequestMapping
(
value
=
"/upFinanceWechat"
)
@RequestMapping
(
value
=
"/upFinanceWechat"
)
public
String
upFinanceWechat
(
MultipartFile
file
)
{
public
String
upFinanceWechat
(
MultipartFile
file
)
{
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
...
@@ -115,6 +144,12 @@ public class FianceController {
...
@@ -115,6 +144,12 @@ public class FianceController {
return
"showfinance"
;
return
"showfinance"
;
}
}
/**
* 更新金融需要的微博文件
*
* @param file
* @return
*/
@RequestMapping
(
value
=
"/upFinanceWeibo"
)
@RequestMapping
(
value
=
"/upFinanceWeibo"
)
public
String
upFinanceWeibo
(
MultipartFile
file
)
{
public
String
upFinanceWeibo
(
MultipartFile
file
)
{
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
...
@@ -137,6 +172,12 @@ public class FianceController {
...
@@ -137,6 +172,12 @@ public class FianceController {
return
"showfinance"
;
return
"showfinance"
;
}
}
/**
* 更新金融需要的短来源文件
*
* @param file
* @return
*/
@RequestMapping
(
value
=
"/upFinanceLess"
)
@RequestMapping
(
value
=
"/upFinanceLess"
)
public
String
upFinanceLess
(
MultipartFile
file
)
{
public
String
upFinanceLess
(
MultipartFile
file
)
{
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
...
@@ -159,6 +200,12 @@ public class FianceController {
...
@@ -159,6 +200,12 @@ public class FianceController {
return
"redirect:upExcel"
;
return
"redirect:upExcel"
;
}
}
/**
* 获取所有文件
*
* @param file
* @return
*/
@RequestMapping
(
value
=
"/getAll"
,
produces
=
"application/json;charset=utf-8"
)
@RequestMapping
(
value
=
"/getAll"
,
produces
=
"application/json;charset=utf-8"
)
@ResponseBody
@ResponseBody
public
String
getAll
()
{
public
String
getAll
()
{
...
...
src/main/java/com/zhiwei/servlet/MainController.java
View file @
c57b50d9
...
@@ -18,7 +18,6 @@ import org.apache.commons.logging.Log;
...
@@ -18,7 +18,6 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
...
@@ -28,6 +27,12 @@ import com.zhiwei.util.Config;
...
@@ -28,6 +27,12 @@ import com.zhiwei.util.Config;
import
com.zw.entity.Excels
;
import
com.zw.entity.Excels
;
import
com.zw.entity.Weixin
;
import
com.zw.entity.Weixin
;
/**
* 转链接
*
* @author admin
*
*/
@Controller
@Controller
public
class
MainController
{
public
class
MainController
{
...
@@ -37,11 +42,23 @@ public class MainController {
...
@@ -37,11 +42,23 @@ public class MainController {
public
static
Excels
excel
=
null
;
public
static
Excels
excel
=
null
;
public
static
int
finished
=
0
;
public
static
int
finished
=
0
;
/**
* 转链接上传页面
*
* @return
*/
@RequestMapping
(
"/scanExcel"
)
@RequestMapping
(
"/scanExcel"
)
public
String
mian
()
{
public
String
mian
()
{
return
"test"
;
return
"test"
;
}
}
/**
* 转链接数据接口
*
* @param request
* @param response
* @throws IOException
*/
@RequestMapping
(
value
=
"/show"
)
@RequestMapping
(
value
=
"/show"
)
public
void
shows
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
public
void
shows
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
System
.
out
.
println
(
lists
.
size
());
System
.
out
.
println
(
lists
.
size
());
...
@@ -66,6 +83,12 @@ public class MainController {
...
@@ -66,6 +83,12 @@ public class MainController {
}
}
}
}
/**
* 转链接下载接口
*
* @param request
* @param response
*/
@RequestMapping
(
value
=
"/downLode"
)
@RequestMapping
(
value
=
"/downLode"
)
public
void
downLode
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
void
downLode
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
System
.
out
.
println
(
ExcelReadAndWrite
.
findEf
());
System
.
out
.
println
(
ExcelReadAndWrite
.
findEf
());
...
@@ -87,6 +110,13 @@ public class MainController {
...
@@ -87,6 +110,13 @@ public class MainController {
}
}
}
}
/**
* 根据id下载文件
*
* @param request
* @param response
* @param id
*/
@RequestMapping
(
value
=
"/downLodeFile"
)
@RequestMapping
(
value
=
"/downLodeFile"
)
public
void
downFile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
public
void
downFile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
System
.
out
.
println
(
ExcelReadAndWrite
.
findEf
());
System
.
out
.
println
(
ExcelReadAndWrite
.
findEf
());
...
@@ -110,6 +140,13 @@ public class MainController {
...
@@ -110,6 +140,13 @@ public class MainController {
}
}
}
}
/**
* 删除文件
*
* @param request
* @param response
* @param id
*/
@RequestMapping
(
value
=
"/delete"
)
@RequestMapping
(
value
=
"/delete"
)
public
void
delete
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
public
void
delete
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
Map
<
String
,
Boolean
>
map
=
new
HashMap
<
String
,
Boolean
>();
Map
<
String
,
Boolean
>
map
=
new
HashMap
<
String
,
Boolean
>();
...
@@ -142,6 +179,13 @@ public class MainController {
...
@@ -142,6 +179,13 @@ public class MainController {
}
}
}
}
/**
* 插队
*
* @param request
* @param response
* @param id
*/
@RequestMapping
(
value
=
"cutQ"
)
@RequestMapping
(
value
=
"cutQ"
)
public
void
cutQ
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
public
void
cutQ
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
Map
<
String
,
Boolean
>
map
=
new
HashMap
<
String
,
Boolean
>();
Map
<
String
,
Boolean
>
map
=
new
HashMap
<
String
,
Boolean
>();
...
@@ -172,21 +216,47 @@ public class MainController {
...
@@ -172,21 +216,47 @@ public class MainController {
}
}
}
}
/**
* 转链接显示进度页面
*
* @return
*/
@RequestMapping
(
"/sh"
)
@RequestMapping
(
"/sh"
)
public
String
showPage
()
{
public
String
showPage
()
{
return
"dataTable"
;
return
"dataTable"
;
}
}
/**
* 转链接插队页面
*
* @return
*/
@RequestMapping
(
"/admin"
)
@RequestMapping
(
"/admin"
)
public
String
showPageAdmin
()
{
public
String
showPageAdmin
()
{
return
"dataTable2"
;
return
"dataTable2"
;
}
}
/**
* 转链接下载页面
*
* @return
*/
@RequestMapping
(
"/down"
)
@RequestMapping
(
"/down"
)
public
String
down
()
{
public
String
down
()
{
return
"dataTable3"
;
return
"dataTable3"
;
}
}
/**
* 转链接文件上传
*
* @param req
* @param res
* @param file
* @param mail
* @param mail2
* @return
* @throws Exception
*/
@RequestMapping
(
value
=
"/up"
)
@RequestMapping
(
value
=
"/up"
)
public
String
up
(
HttpServletRequest
req
,
HttpServletResponse
res
,
MultipartFile
file
,
String
mail
,
String
mail2
)
public
String
up
(
HttpServletRequest
req
,
HttpServletResponse
res
,
MultipartFile
file
,
String
mail
,
String
mail2
)
throws
Exception
{
throws
Exception
{
...
@@ -230,7 +300,7 @@ public class MainController {
...
@@ -230,7 +300,7 @@ public class MainController {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
try
{
try
{
ExcelReadAndWrite
.
save2
();
ExcelReadAndWrite
.
doChangeUrl
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -242,15 +312,4 @@ public class MainController {
...
@@ -242,15 +312,4 @@ public class MainController {
}
}
return
"error3"
;
return
"error3"
;
}
}
@RequestMapping
(
value
=
"/zhNum"
,
produces
=
"application/json;charset=utf-8"
)
@ResponseBody
public
String
getzhNum
()
{
return
JSON
.
toJSONString
(
map
);
}
@RequestMapping
(
"/zh"
)
public
String
zh
()
{
return
"zhihu"
;
}
}
}
src/main/java/com/zhiwei/servlet/RwController.java
View file @
c57b50d9
...
@@ -25,12 +25,24 @@ import com.zhiwei.util.Config;
...
@@ -25,12 +25,24 @@ import com.zhiwei.util.Config;
import
com.zw.entity.Excels
;
import
com.zw.entity.Excels
;
import
com.zw.entity.ReadWechat
;
import
com.zw.entity.ReadWechat
;
/**
* 点赞阅读
*
* @author admin
*
*/
@Controller
@Controller
public
class
RwController
{
public
class
RwController
{
private
final
static
Log
log
=
LogFactory
.
getLog
(
RwController
.
class
);
private
final
static
Log
log
=
LogFactory
.
getLog
(
RwController
.
class
);
public
static
Vector
<
Excels
>
weChatList
=
new
Vector
<
Excels
>();
public
static
Vector
<
Excels
>
weChatList
=
new
Vector
<
Excels
>();
/**
* 点赞阅读下载文件接口
*
* @param request
* @param response
*/
@RequestMapping
(
value
=
"/rwdownLode"
)
@RequestMapping
(
value
=
"/rwdownLode"
)
public
void
downLode
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
void
downLode
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
System
.
out
.
println
(
ExcelReadAndWrite
.
findEf
());
System
.
out
.
println
(
ExcelReadAndWrite
.
findEf
());
...
@@ -49,6 +61,13 @@ public class RwController {
...
@@ -49,6 +61,13 @@ public class RwController {
}
}
}
}
/**
* 点赞阅读文件下载
*
* @param request
* @param response
* @param id
*/
@RequestMapping
(
value
=
"/rwdownLodeFile"
)
@RequestMapping
(
value
=
"/rwdownLodeFile"
)
public
void
downFile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
public
void
downFile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
id
)
{
try
{
try
{
...
@@ -71,6 +90,17 @@ public class RwController {
...
@@ -71,6 +90,17 @@ public class RwController {
}
}
}
}
/**
* 点赞阅读文件上传
*
* @param req
* @param res
* @param file
* @param mail
* @param mail2
* @return
* @throws Exception
*/
@RequestMapping
(
value
=
"/weChatup"
)
@RequestMapping
(
value
=
"/weChatup"
)
public
String
weChatup
(
HttpServletRequest
req
,
HttpServletResponse
res
,
MultipartFile
file
,
String
mail
,
public
String
weChatup
(
HttpServletRequest
req
,
HttpServletResponse
res
,
MultipartFile
file
,
String
mail
,
String
mail2
)
throws
Exception
{
String
mail2
)
throws
Exception
{
...
@@ -124,21 +154,43 @@ public class RwController {
...
@@ -124,21 +154,43 @@ public class RwController {
return
"error3"
;
return
"error3"
;
}
}
/**
* 点赞阅读上传后的显示页面
*
* @return
*/
@RequestMapping
(
"/rwsh"
)
@RequestMapping
(
"/rwsh"
)
public
String
readshowPage
()
{
public
String
readshowPage
()
{
return
"readShow"
;
return
"readShow"
;
}
}
/**
* 点赞阅读的下载页面
*
* @return
*/
@RequestMapping
(
"/rwdown"
)
@RequestMapping
(
"/rwdown"
)
public
String
rwdown
()
{
public
String
rwdown
()
{
return
"readWechatDown"
;
return
"readWechatDown"
;
}
}
/**
* 点赞阅读的上传文件页面
*
* @return
*/
@RequestMapping
(
"/rwExcel"
)
@RequestMapping
(
"/rwExcel"
)
public
String
rwExcel
()
{
public
String
rwExcel
()
{
return
"readWechat"
;
return
"readWechat"
;
}
}
/**
* 点赞阅读数据显示接口
*
* @param request
* @param response
* @throws IOException
*/
@RequestMapping
(
value
=
"/rwShow"
)
@RequestMapping
(
value
=
"/rwShow"
)
public
void
readShows
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
public
void
readShows
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
System
.
out
.
println
(
weChatList
.
size
());
System
.
out
.
println
(
weChatList
.
size
());
...
...
src/main/java/com/zhiwei/util/AESUtils.java
View file @
c57b50d9
...
@@ -2,10 +2,17 @@ package com.zhiwei.util;
...
@@ -2,10 +2,17 @@ package com.zhiwei.util;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
javax.crypto.Cipher
;
import
javax.crypto.Cipher
;
import
javax.crypto.spec.IvParameterSpec
;
import
javax.crypto.spec.IvParameterSpec
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.crypto.spec.SecretKeySpec
;
/**
* 加密解析aes
*
* @author admin
*
*/
public
class
AESUtils
{
public
class
AESUtils
{
public
static
String
encrypt
(
String
secret
,
String
value
)
{
public
static
String
encrypt
(
String
secret
,
String
value
)
{
SecretKeySpec
keySpec
=
getKey
(
secret
);
SecretKeySpec
keySpec
=
getKey
(
secret
);
...
...
src/main/java/com/zhiwei/util/Config.java
View file @
c57b50d9
...
@@ -4,20 +4,27 @@ import java.io.FileInputStream;
...
@@ -4,20 +4,27 @@ import java.io.FileInputStream;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.util.Properties
;
import
java.util.Properties
;
/**
* 配置读取
*
* @author admin
*
*/
public
class
Config
{
public
class
Config
{
public
static
Properties
p
=
new
Properties
();
public
static
Properties
p
=
new
Properties
();
static
{
static
{
String
fileurl
=
Config
.
class
.
getClassLoader
().
getResource
(
"datasource.properties"
).
getPath
();
String
fileurl
=
Config
.
class
.
getClassLoader
().
getResource
(
"datasource.properties"
).
getPath
();
p
=
new
Properties
();
p
=
new
Properties
();
try
{
try
{
InputStreamReader
in
=
new
InputStreamReader
(
new
FileInputStream
(
fileurl
),
"utf-8"
);
InputStreamReader
in
=
new
InputStreamReader
(
new
FileInputStream
(
fileurl
),
"utf-8"
);
p
.
load
(
in
);
/// 加载属性列表
p
.
load
(
in
);
/// 加载属性列表
in
.
close
();
in
.
close
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
}
}
public
static
String
getVal
(
String
key
){
public
static
String
getVal
(
String
key
)
{
return
p
.
getProperty
(
key
);
return
p
.
getProperty
(
key
);
}
}
}
}
src/main/java/com/zhiwei/util/JsonToObject.java
View file @
c57b50d9
...
@@ -3,18 +3,18 @@ package com.zhiwei.util;
...
@@ -3,18 +3,18 @@ package com.zhiwei.util;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.io.PrintStream
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.net.URLConnection
;
import
java.net.URLEncoder
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Iterator
;
import
java.util.List
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
/**
* 数据解析
*
* @author admin
*
*/
public
class
JsonToObject
{
public
class
JsonToObject
{
public
static
String
getToken
()
{
public
static
String
getToken
()
{
...
...
src/main/java/com/zhiwei/util/MongoConnection.java
View file @
c57b50d9
...
@@ -4,6 +4,7 @@ import java.util.ArrayList;
...
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
import
org.bson.Document
;
import
org.bson.Document
;
import
com.mongodb.MongoClient
;
import
com.mongodb.MongoClient
;
import
com.mongodb.client.FindIterable
;
import
com.mongodb.client.FindIterable
;
import
com.mongodb.client.MongoCollection
;
import
com.mongodb.client.MongoCollection
;
...
@@ -11,6 +12,12 @@ import com.mongodb.client.MongoCursor;
...
@@ -11,6 +12,12 @@ import com.mongodb.client.MongoCursor;
import
com.mongodb.client.MongoDatabase
;
import
com.mongodb.client.MongoDatabase
;
import
com.mongodb.client.model.UpdateOptions
;
import
com.mongodb.client.model.UpdateOptions
;
/**
* 文件操作mongo
*
* @author admin
*
*/
public
class
MongoConnection
{
public
class
MongoConnection
{
private
MongoClient
client
;
private
MongoClient
client
;
...
@@ -25,6 +32,7 @@ public class MongoConnection {
...
@@ -25,6 +32,7 @@ public class MongoConnection {
/**
/**
* 更新操作,若没有则插入
* 更新操作,若没有则插入
*
* @param dbName
* @param dbName
* @param collection
* @param collection
* @param document
* @param document
...
@@ -36,12 +44,13 @@ public class MongoConnection {
...
@@ -36,12 +44,13 @@ public class MongoConnection {
filter
.
append
(
"name"
,
document
.
get
(
"name"
));
filter
.
append
(
"name"
,
document
.
get
(
"name"
));
filter
.
append
(
"type"
,
document
.
get
(
"type"
));
filter
.
append
(
"type"
,
document
.
get
(
"type"
));
Document
update
=
new
Document
();
Document
update
=
new
Document
();
update
.
append
(
"$set"
,
new
Document
(
"url"
,
document
.
get
(
"url"
)));
update
.
append
(
"$set"
,
new
Document
(
"url"
,
document
.
get
(
"url"
)));
col
.
updateOne
(
filter
,
update
,
new
UpdateOptions
().
upsert
(
true
));
col
.
updateOne
(
filter
,
update
,
new
UpdateOptions
().
upsert
(
true
));
}
}
/**
/**
* 查询
* 查询
*
* @param dbName
* @param dbName
* @param collection
* @param collection
* @return
* @return
...
@@ -59,30 +68,32 @@ public class MongoConnection {
...
@@ -59,30 +68,32 @@ public class MongoConnection {
return
list
;
return
list
;
}
}
public
Document
find
(
String
dbName
,
String
collection
,
Document
doc
)
{
public
Document
find
(
String
dbName
,
String
collection
,
Document
doc
)
{
MongoDatabase
db
=
getdb
(
dbName
);
MongoDatabase
db
=
getdb
(
dbName
);
MongoCollection
<
Document
>
col
=
db
.
getCollection
(
collection
);
MongoCollection
<
Document
>
col
=
db
.
getCollection
(
collection
);
Document
fid
=
col
.
find
(
doc
).
first
();
Document
fid
=
col
.
find
(
doc
).
first
();
return
fid
;
return
fid
;
}
}
/**
/**
* 条件查询
* 条件查询
*
* @param dbName
* @param dbName
* @param collection
* @param collection
* @return
* @return
*/
*/
public
String
findOne
(
String
dbName
,
String
collection
,
String
name
)
{
public
String
findOne
(
String
dbName
,
String
collection
,
String
name
)
{
MongoDatabase
db
=
getdb
(
dbName
);
MongoDatabase
db
=
getdb
(
dbName
);
MongoCollection
<
Document
>
col
=
db
.
getCollection
(
collection
);
MongoCollection
<
Document
>
col
=
db
.
getCollection
(
collection
);
FindIterable
<
Document
>
fid
=
col
.
find
(
new
Document
().
append
(
"name"
,
name
));
FindIterable
<
Document
>
fid
=
col
.
find
(
new
Document
().
append
(
"name"
,
name
));
return
fid
.
first
()==
null
?
String
.
valueOf
(
fid
.
first
()):
""
;
return
fid
.
first
()
==
null
?
String
.
valueOf
(
fid
.
first
())
:
""
;
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
MongoConnection
m
=
new
MongoConnection
();
MongoConnection
m
=
new
MongoConnection
();
//
for(Document doc:m.find("financePush","excelPath")) {
//
for(Document doc:m.find("financePush","excelPath")) {
//
System.out.println(doc);
//
System.out.println(doc);
//
}
//
}
}
}
}
}
src/main/java/com/zhiwei/util/ReadWechatConnect.java
View file @
c57b50d9
...
@@ -23,6 +23,12 @@ import com.mongodb.client.MongoDatabase;
...
@@ -23,6 +23,12 @@ import com.mongodb.client.MongoDatabase;
import
com.zw.entity.ExcelFile
;
import
com.zw.entity.ExcelFile
;
import
com.zw.entity.ReadWechat
;
import
com.zw.entity.ReadWechat
;
/**
* 点赞阅读连接mongo
*
* @author admin
*
*/
public
class
ReadWechatConnect
{
public
class
ReadWechatConnect
{
private
MongoClient
client
;
private
MongoClient
client
;
...
...
src/main/java/com/zhiwei/util/StringUtil.java
View file @
c57b50d9
package
com
.
zhiwei
.
util
;
package
com
.
zhiwei
.
util
;
/**
* 字符操作工具
*
* @author admin
*
*/
public
class
StringUtil
{
public
class
StringUtil
{
public
static
boolean
isEmpty
(
String
str
)
{
public
static
boolean
isEmpty
(
String
str
)
{
return
str
==
null
||
str
.
equals
(
""
);
return
str
==
null
||
str
.
equals
(
""
);
}
}
}
}
src/main/java/com/zw/entity/ExcelFile.java
View file @
c57b50d9
package
com
.
zw
.
entity
;
package
com
.
zw
.
entity
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.mongodb.connection.Server
;
/**
* 文件类
public
class
ExcelFile
implements
Serializable
{
*
* @author admin
*
*/
public
class
ExcelFile
implements
Serializable
{
private
String
id
;
private
String
id
;
private
String
url
;
private
String
url
;
private
String
mail
;
private
String
mail
;
private
String
date
;
private
String
date
;
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
}
}
public
void
setId
(
String
id
)
{
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
String
getUrl
()
{
public
String
getUrl
()
{
return
url
;
return
url
;
}
}
public
void
setUrl
(
String
url
)
{
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
this
.
url
=
url
;
}
}
public
String
getMail
()
{
public
String
getMail
()
{
return
mail
;
return
mail
;
}
}
public
void
setMail
(
String
mail
)
{
public
void
setMail
(
String
mail
)
{
this
.
mail
=
mail
;
this
.
mail
=
mail
;
}
}
public
String
getDate
()
{
public
String
getDate
()
{
return
date
;
return
date
;
}
}
public
void
setDate
(
String
date
)
{
public
void
setDate
(
String
date
)
{
this
.
date
=
date
;
this
.
date
=
date
;
}
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"ExcelFile [url="
+
url
+
", mail="
+
mail
+
", date="
+
date
+
"]"
;
return
"ExcelFile [url="
+
url
+
", mail="
+
mail
+
", date="
+
date
+
"]"
;
}
}
}
}
src/main/java/com/zw/entity/Excels.java
View file @
c57b50d9
...
@@ -2,6 +2,12 @@ package com.zw.entity;
...
@@ -2,6 +2,12 @@ package com.zw.entity;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
* 金融文件操作类
*
* @author admin
*
*/
public
class
Excels
implements
Serializable
{
public
class
Excels
implements
Serializable
{
private
String
id
;
private
String
id
;
...
@@ -12,54 +18,69 @@ public class Excels implements Serializable {
...
@@ -12,54 +18,69 @@ public class Excels implements Serializable {
private
int
site
;
// 当前位置
private
int
site
;
// 当前位置
private
int
surplusCount
;
// 剩余条数
private
int
surplusCount
;
// 剩余条数
private
String
state
;
private
String
state
;
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
}
}
public
void
setId
(
String
id
)
{
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
String
getUrl
()
{
public
String
getUrl
()
{
return
url
;
return
url
;
}
}
public
void
setUrl
(
String
url
)
{
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
this
.
url
=
url
;
}
}
public
String
getMail
()
{
public
String
getMail
()
{
return
mail
;
return
mail
;
}
}
public
void
setMail
(
String
mail
)
{
public
void
setMail
(
String
mail
)
{
this
.
mail
=
mail
;
this
.
mail
=
mail
;
}
}
public
String
getStartDate
()
{
public
String
getStartDate
()
{
return
startDate
;
return
startDate
;
}
}
public
void
setStartDate
(
String
startDate
)
{
public
void
setStartDate
(
String
startDate
)
{
this
.
startDate
=
startDate
;
this
.
startDate
=
startDate
;
}
}
public
double
getNeed
()
{
public
double
getNeed
()
{
return
need
;
return
need
;
}
}
public
void
setNeed
(
double
need
)
{
public
void
setNeed
(
double
need
)
{
this
.
need
=
need
;
this
.
need
=
need
;
}
}
public
int
getSite
()
{
public
int
getSite
()
{
return
site
;
return
site
;
}
}
public
void
setSite
(
int
site
)
{
public
void
setSite
(
int
site
)
{
this
.
site
=
site
;
this
.
site
=
site
;
}
}
public
int
getSurplusCount
()
{
public
int
getSurplusCount
()
{
return
surplusCount
;
return
surplusCount
;
}
}
public
void
setSurplusCount
(
int
surplusCount
)
{
public
void
setSurplusCount
(
int
surplusCount
)
{
this
.
surplusCount
=
surplusCount
;
this
.
surplusCount
=
surplusCount
;
}
}
public
String
getState
()
{
public
String
getState
()
{
return
state
;
return
state
;
}
}
public
void
setState
(
String
state
)
{
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
this
.
state
=
state
;
}
}
}
}
src/main/java/com/zw/entity/ReadWechat.java
View file @
c57b50d9
package
com
.
zw
.
entity
;
package
com
.
zw
.
entity
;
/**
* 点赞阅读
*
* @author admin
*
*/
public
class
ReadWechat
{
public
class
ReadWechat
{
private
String
title
;
private
String
title
;
...
...
src/main/java/com/zw/entity/Weixin.java
View file @
c57b50d9
package
com
.
zw
.
entity
;
package
com
.
zw
.
entity
;
/**
* 微信转链接
*
* @author admin
*
*/
public
class
Weixin
{
public
class
Weixin
{
private
String
source
;
private
String
source
;
...
@@ -10,7 +16,7 @@ public class Weixin {
...
@@ -10,7 +16,7 @@ public class Weixin {
private
String
conetent
;
private
String
conetent
;
private
String
keyValue
;
private
String
keyValue
;
//微博
//
微博
private
String
read
;
private
String
read
;
private
String
zan
;
private
String
zan
;
private
String
nickname
;
private
String
nickname
;
...
@@ -22,109 +28,142 @@ public class Weixin {
...
@@ -22,109 +28,142 @@ public class Weixin {
private
String
markname
;
private
String
markname
;
private
String
trueRead
;
private
String
trueRead
;
public
String
getRead
()
{
public
String
getRead
()
{
return
read
;
return
read
;
}
}
public
void
setRead
(
String
read
)
{
public
void
setRead
(
String
read
)
{
this
.
read
=
read
;
this
.
read
=
read
;
}
}
public
String
getZan
()
{
public
String
getZan
()
{
return
zan
;
return
zan
;
}
}
public
void
setZan
(
String
zan
)
{
public
void
setZan
(
String
zan
)
{
this
.
zan
=
zan
;
this
.
zan
=
zan
;
}
}
public
String
getNickname
()
{
public
String
getNickname
()
{
return
nickname
;
return
nickname
;
}
}
public
void
setNickname
(
String
nickname
)
{
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
this
.
nickname
=
nickname
;
}
}
public
String
getJianjie
()
{
public
String
getJianjie
()
{
return
jianjie
;
return
jianjie
;
}
}
public
void
setJianjie
(
String
jianjie
)
{
public
void
setJianjie
(
String
jianjie
)
{
this
.
jianjie
=
jianjie
;
this
.
jianjie
=
jianjie
;
}
}
public
String
getHistory
()
{
public
String
getHistory
()
{
return
history
;
return
history
;
}
}
public
void
setHistory
(
String
history
)
{
public
void
setHistory
(
String
history
)
{
this
.
history
=
history
;
this
.
history
=
history
;
}
}
public
String
getLongUrl
()
{
public
String
getLongUrl
()
{
return
longUrl
;
return
longUrl
;
}
}
public
void
setLongUrl
(
String
longUrl
)
{
public
void
setLongUrl
(
String
longUrl
)
{
this
.
longUrl
=
longUrl
;
this
.
longUrl
=
longUrl
;
}
}
public
String
getMark
()
{
public
String
getMark
()
{
return
mark
;
return
mark
;
}
}
public
void
setMark
(
String
mark
)
{
public
void
setMark
(
String
mark
)
{
this
.
mark
=
mark
;
this
.
mark
=
mark
;
}
}
public
String
getMark_time
()
{
public
String
getMark_time
()
{
return
mark_time
;
return
mark_time
;
}
}
public
void
setMark_time
(
String
mark_time
)
{
public
void
setMark_time
(
String
mark_time
)
{
this
.
mark_time
=
mark_time
;
this
.
mark_time
=
mark_time
;
}
}
public
String
getMarkname
()
{
public
String
getMarkname
()
{
return
markname
;
return
markname
;
}
}
public
void
setMarkname
(
String
markname
)
{
public
void
setMarkname
(
String
markname
)
{
this
.
markname
=
markname
;
this
.
markname
=
markname
;
}
}
public
String
getTrueRead
()
{
public
String
getTrueRead
()
{
return
trueRead
;
return
trueRead
;
}
}
public
void
setTrueRead
(
String
trueRead
)
{
public
void
setTrueRead
(
String
trueRead
)
{
this
.
trueRead
=
trueRead
;
this
.
trueRead
=
trueRead
;
}
}
public
String
getKeyValue
()
{
public
String
getKeyValue
()
{
return
keyValue
;
return
keyValue
;
}
}
public
void
setKeyValue
(
String
keyValue
)
{
public
void
setKeyValue
(
String
keyValue
)
{
this
.
keyValue
=
keyValue
;
this
.
keyValue
=
keyValue
;
}
}
public
String
getConetent
()
{
public
String
getConetent
()
{
return
conetent
;
return
conetent
;
}
}
public
void
setConetent
(
String
conetent
)
{
public
void
setConetent
(
String
conetent
)
{
this
.
conetent
=
conetent
;
this
.
conetent
=
conetent
;
}
}
public
String
getSource
()
{
public
String
getSource
()
{
return
source
;
return
source
;
}
}
public
void
setSource
(
String
source
)
{
public
void
setSource
(
String
source
)
{
this
.
source
=
source
;
this
.
source
=
source
;
}
}
public
String
getUrl
()
{
public
String
getUrl
()
{
return
url
;
return
url
;
}
}
public
void
setUrl
(
String
url
)
{
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
this
.
url
=
url
;
}
}
public
String
getGetUrl
()
{
public
String
getGetUrl
()
{
return
getUrl
;
return
getUrl
;
}
}
public
void
setGetUrl
(
String
getUrl
)
{
public
void
setGetUrl
(
String
getUrl
)
{
this
.
getUrl
=
getUrl
;
this
.
getUrl
=
getUrl
;
}
}
public
String
getTitle
()
{
public
String
getTitle
()
{
return
title
;
return
title
;
}
}
public
void
setTitle
(
String
title
)
{
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
this
.
title
=
title
;
}
}
public
String
getTime
()
{
public
String
getTime
()
{
return
time
;
return
time
;
}
}
public
void
setTime
(
String
time
)
{
public
void
setTime
(
String
time
)
{
this
.
time
=
time
;
this
.
time
=
time
;
}
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"Weixin [source="
+
source
+
", url="
+
url
+
", getUrl="
+
getUrl
+
", title="
+
title
+
", time="
return
"Weixin [source="
+
source
+
", url="
+
url
+
", getUrl="
+
getUrl
+
", title="
+
title
+
", time="
...
@@ -134,7 +173,4 @@ public class Weixin {
...
@@ -134,7 +173,4 @@ public class Weixin {
+
"]"
;
+
"]"
;
}
}
}
}
src/main/java/sendmail/SendMailUtil.java
View file @
c57b50d9
...
@@ -7,10 +7,8 @@ import java.util.Properties;
...
@@ -7,10 +7,8 @@ import java.util.Properties;
import
javax.activation.DataHandler
;
import
javax.activation.DataHandler
;
import
javax.activation.DataSource
;
import
javax.activation.DataSource
;
import
javax.activation.FileDataSource
;
import
javax.activation.FileDataSource
;
import
javax.annotation.Resource
;
import
javax.mail.BodyPart
;
import
javax.mail.BodyPart
;
import
javax.mail.Multipart
;
import
javax.mail.Multipart
;
import
javax.mail.PasswordAuthentication
;
import
javax.mail.Session
;
import
javax.mail.Session
;
import
javax.mail.Transport
;
import
javax.mail.Transport
;
import
javax.mail.internet.InternetAddress
;
import
javax.mail.internet.InternetAddress
;
...
@@ -22,7 +20,7 @@ import org.apache.commons.logging.Log;
...
@@ -22,7 +20,7 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
/**
/**
*
閭欢鍙戯拷?锟藉伐鍏风被
*
邮件发送
*
*
* @author shenjinzhu
* @author shenjinzhu
*/
*/
...
...
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