作者 zhangFan

修改错误信息

... ... @@ -14,15 +14,15 @@ spring.mvc.view.suffix=/WEB-INF/jsp/
#\u6620\u5C04\u540E\u7F00
spring.mvc.view.prefix=.jsp
#\u8BBE\u7F6E\u672C\u5730\u6570\u636E\u6E90
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
#\u8BBE\u7F6E\u7EBF\u4E0A\u6570\u636E\u6E90
#spring.datasource.username=root
#spring.datasource.password=root
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
#spring.datasource.username=station
#spring.datasource.password=station@10.50.7.70
#\u8BBE\u7F6E\u7EBF\u4E0A\u6570\u636E\u6E90
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://10.50.7.60:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
spring.datasource.username=station
spring.datasource.password=station@10.50.7.70
#\u8FDE\u63A5\u6C60\u7C7B
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
#\u8FDE\u63A5\u6C60\u914D\u7F6E\uFF0C\u56E0\u4E3Aspringboot\u9ED8\u8BA4\u662F\u5F00\u542F\u4E86\u8FDE\u63A5\u6C60\u7684\uFF0C\u5B83\u6709\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u8FD9\u4E00\u6BB5\u53EF\u4EE5\u5FFD\u7565
... ...
... ... @@ -40,13 +40,13 @@ public class IMF_Tesk {
/**
* 往IMF发送报文
*/
// if(!KAKO_Sender.isrunning){
// KAKO_Sender kako_sender = new KAKO_Sender(client);
// kako_sender.start();
// logger.info("<<<<<<<<<KAKO发送线程已开启>>>>>>>>>>>>");
// }else {
// logger.info("<<<<<<<<<KAKO发送线程已开启-不再启动线程>>>>>>>>>>>>");
// }
if(!KAKO_Sender.isrunning){
KAKO_Sender kako_sender = new KAKO_Sender(client);
kako_sender.start();
logger.info("<<<<<<<<<KAKO发送线程已开启>>>>>>>>>>>>");
}else {
logger.info("<<<<<<<<<KAKO发送线程已开启-不再启动线程>>>>>>>>>>>>");
}
}
if (!LOGIN_OK){
... ...
... ... @@ -10,27 +10,29 @@ import org.apache.log4j.Logger;
import java.io.File;
import java.util.List;
public class KAKO_Sender extends Thread{
public class KAKO_Sender extends Thread {
protected static final Logger logger = Logger.getLogger(KAKO_Sender.class);
public static boolean isrunning;
public static boolean isrunning;
private IMFClient client;
private String content;
public KAKO_Sender(IMFClient client) {
this.client = client;
}
public KAKO_Sender(IMFClient client, String content) {
this.client = client;
this.content = content;
}
public void run(){
public void run() {
try {
String sendDir = FileTool.readProperties("sendDirectory");
String sendDir = FileTool.readProperties("sendDirectory");
String SNDR = FileTool.readProperties("loginname");
String TYPE = FileTool.readProperties("TYPE");
String STYP = FileTool.readProperties("STYP");
String RCVR = FileTool.readProperties("RCVR");
String TYPE = FileTool.readProperties("TYPE");
String STYP = FileTool.readProperties("STYP");
String RCVR = FileTool.readProperties("RCVR");
// String DDTM = new DateTimeConverter().dateFormat();
// String SEQN = DDTM;
... ... @@ -38,34 +40,37 @@ public class KAKO_Sender extends Thread{
logger.info("IMFClient has been closed");
return;
}
isrunning=true;
if(IMF_Tesk.LOGIN_OK){
while (true){
List<File> files = FileTool.readDirectoryFiles(new File(sendDir));
for (File file:files) {
String fileContent = FileTool.readfile(file);
String sendMsg = MakeImfMeta.makeImfDocument(SNDR,RCVR,TYPE,STYP,new DateTimeConverter().dateFormat(),new DateTimeConverter().dateFormat(),fileContent);
String returnMsg = this.client.sendMSG(sendMsg);
//发送成功处理,删除已发送成功的目录下的文件
if(returnMsg.indexOf("<CODE>9</CODE>")>=0){
FileUtils.forceDelete(file);
}
}
isrunning = true;
if (IMF_Tesk.LOGIN_OK) {
List<File> files = FileTool.readDirectoryFiles(new File(sendDir));
for (File file : files) {
String fileContent = "";
try {
Thread.sleep(500L);
} catch (InterruptedException var3) {
var3.printStackTrace();
fileContent = FileTool.readfile(file);
} catch (Exception e) {
FileUtils.forceDelete(file);
continue;
}
String sendMsg = MakeImfMeta.makeImfDocument(SNDR, RCVR, TYPE, STYP, new DateTimeConverter().dateFormat(), new DateTimeConverter().dateFormat(), fileContent);
String returnMsg = this.client.sendMSG(sendMsg);
//发送成功处理,删除已发送成功的目录下的文件
String msg = "<CODE>9</CODE>";
if (returnMsg.contains(msg)) {
FileUtils.forceDelete(file);
}
}
try {
Thread.sleep(500L);
} catch (InterruptedException var3) {
var3.printStackTrace();
}
}
}catch (Exception var14) {
} catch (Exception var14) {
var14.printStackTrace();
logger.info(var14.getMessage());
}
isrunning=false;
isrunning = false;
logger.info("<<<<<<<<<<<发送线程不在了>>>>>>>>>>>>");
}
}
... ...
... ... @@ -83,6 +83,9 @@ public class LogicOperation {
* @Result 计算卡口采集数据并发送报文
*/
public static boolean operation(GatherInfo info) {
if("综保区".equals(info.getAreaid())){
//todo 加综保区的判断逻辑
}
PropertyConfigurator.configure("config/log4j.properties");
boolean result = false;
//转为double类型
... ...
... ... @@ -4,8 +4,7 @@ import com.sy.model.LandBusinessTypeList;
import com.sy.utils.DateTimeConverter;
import com.sy.utils.FileTool;
import java.io.FileWriter;
import java.io.IOException;
import java.io.*;
/**
* @author
... ... @@ -18,12 +17,19 @@ public class VeManifestRelation {
public static boolean createFile(LandBusinessTypeList landBusinessTypeList){
boolean flag = false;
FileWriter fileWriter;
// FileWriter fileWriter;
File file;
try {
fileWriter = new FileWriter(veManifestDirectory+new DateTimeConverter().dateFormat()+".xml");
fileWriter.write(new VeManifestRelation().getMsg(landBusinessTypeList));
fileWriter.flush();
fileWriter.close();
// fileWriter = new FileWriter(veManifestDirectory+new DateTimeConverter().dateFormat()+".xml");
//
// fileWriter.write(new VeManifestRelation().getMsg(landBusinessTypeList));
// fileWriter.flush();
// fileWriter.close();
file = new File(veManifestDirectory+new DateTimeConverter().dateFormat()+".xml");
Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file),"UTF-8"));
writer.write(new VeManifestRelation().getMsg(landBusinessTypeList));
writer.flush();
writer.close();
flag = true;
}catch (IOException e){
e.printStackTrace();
... ...
package com.sy;
/**
* @author
* @time 2019-${MOUTH}-06 17:59
*/
public class test {
// private static LogicOperation logicOperation =new LogicOperation();
/* public static void main(String[] args) {
double a = logicOperation.GoodsWt("172-26481560,172-26481593,172-26481604,172-26481545,172-26481582,172-26481556,172-26481571","I");
System.out.printf("%.1f",a);
}*/
}