Commit 35054b66 by admin

修改excel读取的判断条件

parent e9c3e34a
...@@ -33,13 +33,7 @@ import com.zw.entity.Weixin; ...@@ -33,13 +33,7 @@ import com.zw.entity.Weixin;
import jxl.Cell; import jxl.Cell;
import jxl.Sheet; import jxl.Sheet;
import jxl.Workbook; 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.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet; import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook; import jxl.write.WritableWorkbook;
import jxl.write.WriteException; import jxl.write.WriteException;
...@@ -146,28 +140,6 @@ public class ExcelReadAndWrite { ...@@ -146,28 +140,6 @@ public class ExcelReadAndWrite {
WritableSheet sheet = workbook.createSheet("table1", 0); WritableSheet sheet = workbook.createSheet("table1", 0);
// 一些临时变量,用于写到excel中 // 一些临时变量,用于写到excel中
Label l = null; 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; int seq = 0;
l = new Label(0, seq, "来源"); l = new Label(0, seq, "来源");
sheet.addCell(l); sheet.addCell(l);
...@@ -221,7 +193,6 @@ public class ExcelReadAndWrite { ...@@ -221,7 +193,6 @@ public class ExcelReadAndWrite {
public static void write2222(List<Weixin> list) throws IOException, RowsExceededException, WriteException { public static void write2222(List<Weixin> list) throws IOException, RowsExceededException, WriteException {
File tempFile = new File(url); File tempFile = new File(url);
// 若是文件不存在就创建新文件
if (!tempFile.exists()) { if (!tempFile.exists()) {
tempFile.createNewFile(); tempFile.createNewFile();
} }
......
...@@ -98,7 +98,7 @@ public class ReaderExcel { ...@@ -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); list.add(w);
} }
} }
......
...@@ -70,6 +70,7 @@ public class ReadExcel { ...@@ -70,6 +70,7 @@ public class ReadExcel {
} }
} }
} }
if (rw != null && rw.getUrl() != null && rw.getUrl().length() > 10)
list.add(rw); list.add(rw);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -35,29 +35,18 @@ public class ServerClient extends Thread { ...@@ -35,29 +35,18 @@ public class ServerClient extends Thread {
String line = ""; String line = "";
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream())); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintWriter writer = new PrintWriter(socket.getOutputStream()); PrintWriter writer = new PrintWriter(socket.getOutputStream());
// BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// System.out.println("Client:" + in.readLine());
line = in.readLine(); line = in.readLine();
// line = br.readLine();
if (line != null && line.equals("result")) { if (line != null && line.equals("result")) {
writer.println("result:end"); writer.println("result:end");
writer.flush(); writer.flush();
WechatReadAndWrite.needsend = true; WechatReadAndWrite.need();
log.info("收到result:" + WechatReadAndWrite.needsend); log.info("收到result" + WechatReadAndWrite.needsend);
} else if (line != null) { } else if (line != null) {
writer.println("无效" + line); writer.println("无效" + line);
writer.flush(); writer.flush();
System.out.println("继续接收"); log.info("继续接收");
} }
line = in.readLine(); 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")) { if (line != null && line.equals("asdasd")) {
break; break;
} }
......
...@@ -133,6 +133,10 @@ public class WechatReadAndWrite { ...@@ -133,6 +133,10 @@ public class WechatReadAndWrite {
System.out.println("发送完成"); System.out.println("发送完成");
} }
public static void need() {
needsend = true;
}
public synchronized static void work() { public synchronized static void work() {
runStrat = true; runStrat = true;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -149,7 +153,6 @@ public class WechatReadAndWrite { ...@@ -149,7 +153,6 @@ public class WechatReadAndWrite {
m.insertReadWechat(list);// 存储 m.insertReadWechat(list);// 存储
while (true) { while (true) {
Thread.sleep(1000 * 30); Thread.sleep(1000 * 30);
log.info("执行中。。。。" + needsend);
if (needsend) { if (needsend) {
break; break;
} }
......
...@@ -89,7 +89,7 @@ h5 { ...@@ -89,7 +89,7 @@ h5 {
tbody.append("<tr class='TR'>" tbody.append("<tr class='TR'>"
+"<td class='id'>"+e.site+"</td>" +"<td class='id'>"+e.site+"</td>"
+"<td>"+e.mail+"</td>" +"<td>"+e.mail+"</td>"
+"<td>"+e.surplusCount/3+"</td>" +"<td>"+e.surplusCount/2+"</td>"
+"<td>"+e.startDate+"</td>" +"<td>"+e.startDate+"</td>"
+"</td></tr>") +"</td></tr>")
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment