Commit 2f4a588c by admin

变量修改后测试

parent 50779806
...@@ -12,8 +12,6 @@ import org.springframework.stereotype.Component; ...@@ -12,8 +12,6 @@ import org.springframework.stereotype.Component;
@Component @Component
public class ServerClient extends Thread { public class ServerClient extends Thread {
public static boolean needSend = false;
public ServerClient() { public ServerClient() {
this.start(); this.start();
} }
...@@ -41,7 +39,7 @@ public class ServerClient extends Thread { ...@@ -41,7 +39,7 @@ public class ServerClient extends Thread {
if (line != null && line.equals("result")) { if (line != null && line.equals("result")) {
writer.println("result:end"); writer.println("result:end");
writer.flush(); writer.flush();
needSend = true; WechatReadAndWrite.needsend = true;
System.out.println("收到result"); System.out.println("收到result");
} else if (line != null) { } else if (line != null) {
writer.println("无效" + line); writer.println("无效" + line);
......
...@@ -34,7 +34,7 @@ import sendmail.SendMailUtil; ...@@ -34,7 +34,7 @@ import sendmail.SendMailUtil;
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;
public static boolean cut = false; public static boolean needsend = false;
public static String url = Config.getVal("basefile"); public static String url = Config.getVal("basefile");
public static boolean runStrat = false; public static boolean runStrat = false;
public static int cutCount = 0; public static int cutCount = 0;
...@@ -146,9 +146,12 @@ public class WechatReadAndWrite { ...@@ -146,9 +146,12 @@ public class WechatReadAndWrite {
List<ReadWechat> list = ReadExcel.getExcel(e.getUrl()); List<ReadWechat> list = ReadExcel.getExcel(e.getUrl());
log.info("数据入库"); log.info("数据入库");
m.insertReadWechat(list);// 存储 m.insertReadWechat(list);// 存储
ServerClient.needSend = false; needsend = false;
while (!ServerClient.needSend) { while (true) {
Thread.sleep(1000 * 30); Thread.sleep(1000 * 30);
if (needsend) {
break;
}
} }
log.info("收到结束信息,开始写出文件"); log.info("收到结束信息,开始写出文件");
Map<String, ReadWechat> map = new HashMap<>(); Map<String, ReadWechat> map = new HashMap<>();
......
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