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
35054b66
Commit
35054b66
authored
May 23, 2018
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改excel读取的判断条件
parent
e9c3e34a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
47 deletions
+11
-47
src/main/java/com/zhiwei/chendong/ExcelReadAndWrite.java
+0
-29
src/main/java/com/zhiwei/chendong/ReaderExcel.java
+1
-1
src/main/java/com/zhiwei/readWechat/ReadExcel.java
+2
-1
src/main/java/com/zhiwei/readWechat/ServerClient.java
+3
-14
src/main/java/com/zhiwei/readWechat/WechatReadAndWrite.java
+4
-1
src/main/webapp/readShow.html
+1
-1
No files found.
src/main/java/com/zhiwei/chendong/ExcelReadAndWrite.java
View file @
35054b66
...
...
@@ -33,13 +33,7 @@ import com.zw.entity.Weixin;
import
jxl.Cell
;
import
jxl.Sheet
;
import
jxl.Workbook
;
import
jxl.format.Alignment
;
import
jxl.format.Colour
;
import
jxl.format.UnderlineStyle
;
import
jxl.format.VerticalAlignment
;
import
jxl.write.Label
;
import
jxl.write.WritableCellFormat
;
import
jxl.write.WritableFont
;
import
jxl.write.WritableSheet
;
import
jxl.write.WritableWorkbook
;
import
jxl.write.WriteException
;
...
...
@@ -146,28 +140,6 @@ public class ExcelReadAndWrite {
WritableSheet
sheet
=
workbook
.
createSheet
(
"table1"
,
0
);
// 一些临时变量,用于写到excel中
Label
l
=
null
;
// 标题格式
WritableFont
titleFont
=
new
WritableFont
(
WritableFont
.
ARIAL
,
14
,
WritableFont
.
NO_BOLD
,
false
,
UnderlineStyle
.
NO_UNDERLINE
,
jxl
.
format
.
Colour
.
BLACK
);
WritableCellFormat
titleFormat
=
new
WritableCellFormat
(
titleFont
);
titleFormat
.
setAlignment
(
Alignment
.
CENTRE
);
// 正文字体
WritableFont
detFont
=
new
WritableFont
(
WritableFont
.
ARIAL
,
13
,
WritableFont
.
NO_BOLD
,
false
,
UnderlineStyle
.
NO_UNDERLINE
,
jxl
.
format
.
Colour
.
BLACK
);
WritableCellFormat
detFormat
=
new
WritableCellFormat
(
detFont
);
detFormat
.
setVerticalAlignment
(
VerticalAlignment
.
CENTRE
);
// 财新小字
WritableFont
detFont2
=
new
WritableFont
(
WritableFont
.
ARIAL
,
10
,
WritableFont
.
NO_BOLD
,
false
,
UnderlineStyle
.
NO_UNDERLINE
,
Colour
.
WHITE
);
WritableCellFormat
detFormat2
=
new
WritableCellFormat
(
detFont2
);
detFormat2
.
setBackground
(
Colour
.
BLUE_GREY
);
WritableCellFormat
detFormat3
=
new
WritableCellFormat
(
detFont2
);
detFormat3
.
setBackground
(
Colour
.
BLUE_GREY
);
detFormat3
.
setAlignment
(
Alignment
.
CENTRE
);
WritableFont
urlf
=
new
WritableFont
(
WritableFont
.
ARIAL
,
11
,
WritableFont
.
NO_BOLD
,
false
,
UnderlineStyle
.
NO_UNDERLINE
,
Colour
.
BLUE
);
WritableCellFormat
urlFormat
=
new
WritableCellFormat
(
urlf
);
urlFormat
.
setVerticalAlignment
(
VerticalAlignment
.
CENTRE
);
int
seq
=
0
;
l
=
new
Label
(
0
,
seq
,
"来源"
);
sheet
.
addCell
(
l
);
...
...
@@ -221,7 +193,6 @@ public class ExcelReadAndWrite {
public
static
void
write2222
(
List
<
Weixin
>
list
)
throws
IOException
,
RowsExceededException
,
WriteException
{
File
tempFile
=
new
File
(
url
);
// 若是文件不存在就创建新文件
if
(!
tempFile
.
exists
())
{
tempFile
.
createNewFile
();
}
...
...
src/main/java/com/zhiwei/chendong/ReaderExcel.java
View file @
35054b66
...
...
@@ -98,7 +98,7 @@ public class ReaderExcel {
}
}
}
if
(
w
!=
null
&&
w
.
getUrl
()
!=
null
)
if
(
w
!=
null
&&
w
.
getUrl
()
!=
null
&&
w
.
getUrl
().
length
()
>
10
)
list
.
add
(
w
);
}
}
...
...
src/main/java/com/zhiwei/readWechat/ReadExcel.java
View file @
35054b66
...
...
@@ -70,7 +70,8 @@ public class ReadExcel {
}
}
}
list
.
add
(
rw
);
if
(
rw
!=
null
&&
rw
.
getUrl
()
!=
null
&&
rw
.
getUrl
().
length
()
>
10
)
list
.
add
(
rw
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
src/main/java/com/zhiwei/readWechat/ServerClient.java
View file @
35054b66
...
...
@@ -35,29 +35,18 @@ public class ServerClient extends Thread {
String
line
=
""
;
BufferedReader
in
=
new
BufferedReader
(
new
InputStreamReader
(
socket
.
getInputStream
()));
PrintWriter
writer
=
new
PrintWriter
(
socket
.
getOutputStream
());
// BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// System.out.println("Client:" + in.readLine());
line
=
in
.
readLine
();
// line = br.readLine();
if
(
line
!=
null
&&
line
.
equals
(
"result"
))
{
writer
.
println
(
"result:end"
);
writer
.
flush
();
WechatReadAndWrite
.
need
send
=
true
;
log
.
info
(
"收到result
:
"
+
WechatReadAndWrite
.
needsend
);
WechatReadAndWrite
.
need
()
;
log
.
info
(
"收到result"
+
WechatReadAndWrite
.
needsend
);
}
else
if
(
line
!=
null
)
{
writer
.
println
(
"无效"
+
line
);
writer
.
flush
();
System
.
out
.
println
(
"继续接收"
);
log
.
info
(
"继续接收"
);
}
line
=
in
.
readLine
();
// if (line != null) {
// System.out.println("接收到:" + line);
// try {
// Thread.sleep(1000 * 60);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }
if
(
line
!=
null
&&
line
.
equals
(
"asdasd"
))
{
break
;
}
...
...
src/main/java/com/zhiwei/readWechat/WechatReadAndWrite.java
View file @
35054b66
...
...
@@ -133,6 +133,10 @@ public class WechatReadAndWrite {
System
.
out
.
println
(
"发送完成"
);
}
public
static
void
need
()
{
needsend
=
true
;
}
public
synchronized
static
void
work
()
{
runStrat
=
true
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
...
@@ -149,7 +153,6 @@ public class WechatReadAndWrite {
m
.
insertReadWechat
(
list
);
// 存储
while
(
true
)
{
Thread
.
sleep
(
1000
*
30
);
log
.
info
(
"执行中。。。。"
+
needsend
);
if
(
needsend
)
{
break
;
}
...
...
src/main/webapp/readShow.html
View file @
35054b66
...
...
@@ -89,7 +89,7 @@ h5 {
tbody
.
append
(
"<tr class='TR'>"
+
"<td class='id'>"
+
e
.
site
+
"</td>"
+
"<td>"
+
e
.
mail
+
"</td>"
+
"<td>"
+
e
.
surplusCount
/
3
+
"</td>"
+
"<td>"
+
e
.
surplusCount
/
2
+
"</td>"
+
"<td>"
+
e
.
startDate
+
"</td>"
+
"</td></tr>"
)
})
...
...
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