切换导航条
此项目
正在载入...
登录
zhangFan
/
analysis_imf
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
zhangFan
6 years ago
提交
d88f8373a40e797e02e69a19209942d42e5d695f
1 个父辈
615349c3
add veManifestRealtion
显示空白字符变更
内嵌
并排对比
正在显示
14 个修改的文件
包含
121 行增加
和
43 行删除
src/main/resources/application.properties → config/application.properties
config/config.properties
logs/imf.log
pom.xml
src/main/java/com/sy/AnalysisImfApplication.java
src/main/java/com/sy/IMF/IMF_Tesk.java
src/main/java/com/sy/IMF/KAKO_Reader.java
src/main/java/com/sy/IMF/KAKO_Sender.java
src/main/java/com/sy/logic/LogicOperation.java
src/main/java/com/sy/relation/VeManifestRelation.java
src/main/java/com/sy/utils/DateTimeConverter.java
src/main/java/com/sy/utils/FileTool.java
src/main/resources/generator/generatorConfig.xml
src/main/resources/mapping/LandBusinessTypeListMapper.xml
src/main/resources
/application.properties →
config
/application.properties
查看文件 @
d88f837
...
...
@@ -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://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
#\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
...
...
config/config.properties
查看文件 @
d88f837
#\u767B\u5F55\u8D26\u53F7
loginname
=
K
KW1
loginname
=
K
AOR
#\u5361\u53E3\u6570\u636E\u63A5\u6536KKW1\uFF0C\u5361\u53E3\u53D1\u9001\u6570\u636EKAKO\uFF0C\u653E\u884C\u62A5\u6587 KKFX
#\u767B\u5F55\u5BC6\u7801
loginpass
=
KKW1
loginpass
=
KAOR
#\u53D1\u9001\u62A5\u6587\u76EE\u5F55,\u76F8\u5BF9\u7A0B\u5E8F\u76EE\u5F55
readDirectory
=
D:/bw/sendDirectory
sendDirectory
=
D:/bw/sendDirectory
#\u63A5\u6536\u5B58\u50A8\u62A5\u6587\u76EE\u5F55
bakDirectory
=
D:/bw/receiveDirectory
receiveDirectory
=
D:/bw/receiveDirectory
#\u8F66\u5355\u5173\u7CFB\u62A5\u6587\u76EE\u5F55
veManifestDirectory
=
D:/bw/veManifestDirectory
#IMF MEAT\u62A5\u5934\u914D\u7F6E
RCVR
=
TYPE
=
KA
KO
TYPE
=
KA
OR
STYP
=
CARM
#\u8F7D\u91CD\u4E0E\u79F0\u91CD\u7684\u53EF\u63A7\u8303\u56F4 ?%
...
...
logs/imf.log
已删除
100644 → 0
查看文件 @
615349c
此 diff 太大无法显示。
pom.xml
查看文件 @
d88f837
...
...
@@ -413,13 +413,6 @@
<artifactId>
httpclient
</artifactId>
<version>
4.5.5
</version>
</dependency>
<!--
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.2.0.M1</version>
</dependency>
-->
</dependencies>
...
...
src/main/java/com/sy/AnalysisImfApplication.java
查看文件 @
d88f837
...
...
@@ -7,6 +7,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
//不连接数据库开启服务
//@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
//@EnableEurekaClient
@MapperScan
(
value
=
"com.sy.mapper"
)
public
class
AnalysisImfApplication
{
...
...
src/main/java/com/sy/IMF/IMF_Tesk.java
查看文件 @
d88f837
...
...
@@ -26,21 +26,27 @@ public class IMF_Tesk {
if
(
client
!=
null
)
{
/**
* 从IMF接收报文
*/
if
(!
KAKO_Reader
.
isrunning
)
{
KAKO_Reader
kako_reader
=
new
KAKO_Reader
(
client
);
kako_reader
.
start
();
logger
.
info
(
"*********
KAKO
读取线程已开启***********"
);
logger
.
info
(
"*********读取线程已开启***********"
);
}
else
{
logger
.
info
(
"*********
KAKO
读取线程已开启-不再启动线程*********"
);
logger
.
info
(
"*********读取线程已开启-不再启动线程*********"
);
}
/* if(!KAKO_Sender.isrunning){
KAKO_Sender kako_sender = new KAKO_Sender(client);
kako_sender.start();
logger.info("<<<<<<<<<KAKO发送线程已开启>>>>>>>>>>>>");
}else {
logger.info("<<<<<<<<<KAKO发送线程已开启-不再启动线程>>>>>>>>>>>>");
}*/
/**
* 往IMF发送报文
*/
// 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
){
...
...
src/main/java/com/sy/IMF/KAKO_Reader.java
查看文件 @
d88f837
...
...
@@ -23,6 +23,9 @@ public class KAKO_Reader extends Thread{
if
(
message
!=
null
)
{
// logger.info(message);
AnalysisRoute
.
analysis
(
message
);
// if(message.indexOf("<TYPE>CARM</TYPE>") > 0){
// this.client.sendMSG();
// }
}
}
else
{
...
...
src/main/java/com/sy/IMF/KAKO_Sender.java
查看文件 @
d88f837
...
...
@@ -26,13 +26,13 @@ public class KAKO_Sender extends Thread{
public
void
run
(){
try
{
String
sendDir
=
FileTool
.
readProperties
(
"
rea
dDirectory"
);
String
sendDir
=
FileTool
.
readProperties
(
"
sen
dDirectory"
);
String
SNDR
=
FileTool
.
readProperties
(
"loginname"
);
String
TYPE
=
FileTool
.
readProperties
(
"TYPE"
);
String
STYP
=
FileTool
.
readProperties
(
"STYP"
);
String
RCVR
=
FileTool
.
readProperties
(
"RCVR"
);
String
DDTM
=
DateTimeConverter
.
dateFormat
();
String
SEQN
=
DDTM
;
// String DDTM = new DateTimeConverter().dateFormat();
// String SEQN = DDTM;
if
(
this
.
client
==
null
)
{
logger
.
info
(
"IMFClient has been closed"
);
...
...
@@ -44,7 +44,7 @@ public class KAKO_Sender extends Thread{
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
,
DDTM
,
SEQN
,
fileContent
);
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
){
...
...
src/main/java/com/sy/logic/LogicOperation.java
查看文件 @
d88f837
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.sy.crossDomain.buildBarCode
;
import
com.sy.model.*
;
import
com.sy.relation.VeManifestRelation
;
import
com.sy.service.EnterCancelServer
;
import
com.sy.service.LandBusListService
;
import
com.sy.service.LandRoadVeService
;
...
...
@@ -181,6 +182,9 @@ public class LogicOperation {
checkResult
=
check
||
checkMainfest
;
}
if
(
"查验货"
.
equals
(
list
.
getCocode
())){
checkResult
=
true
;
}
//宽进
if
(
"I"
.
equals
(
info
.
getIetype
()))
{
if
(
check
==
false
&&
checkResult
==
false
)
{
...
...
@@ -240,6 +244,12 @@ public class LogicOperation {
}
result
=
true
;
}
if
(
list
.
getMasterList
().
length
()>
0
){
boolean
flag
=
VeManifestRelation
.
createFile
(
list
);
if
(
flag
){
logger
.
info
(
">>>>>>>>>>-----车单关系报文生成成功-----<<<<<<<<<<<<"
);
}
}
}
else
{
sendError
(
info
);
logger
.
error
(
"------->>>>>>>二维码数据异常,请使用正确的二维码数据<<<<<<<-----"
);
...
...
@@ -309,7 +319,7 @@ public class LogicOperation {
if
(!(
waybill
.
indexOf
(
"-"
)
!=
-
1
))
{
waybill
=
waybill
.
substring
(
0
,
3
)
+
"-"
+
waybill
.
substring
(
3
);
}
String
url
=
"http://10.50.3.
64:8080/tj
/orig/orig?waybill="
+
waybill
+
"&imp="
+
imp
;
String
url
=
"http://10.50.3.
82:8081
/orig/orig?waybill="
+
waybill
+
"&imp="
+
imp
;
// String url = "http://tjfx.15miaoo.com:8003/tj/orig/orig?waybill=" + waybill + "&imp=" + imp;
StringBuilder
json
=
new
StringBuilder
();
Map
map
=
null
;
...
...
src/main/java/com/sy/relation/VeManifestRelation.java
0 → 100644
查看文件 @
d88f837
package
com
.
sy
.
relation
;
import
com.sy.model.LandBusinessTypeList
;
import
com.sy.utils.DateTimeConverter
;
import
com.sy.utils.FileTool
;
import
java.io.FileWriter
;
import
java.io.IOException
;
/**
* @author
* @time 2019-08-07 10:10
* @Desc 车与主单关系报文
*/
public
class
VeManifestRelation
{
private
static
String
veManifestDirectory
=
FileTool
.
readProperties
(
"veManifestDirectory"
);
public
static
boolean
createFile
(
LandBusinessTypeList
landBusinessTypeList
){
boolean
flag
=
false
;
FileWriter
fileWriter
;
try
{
fileWriter
=
new
FileWriter
(
veManifestDirectory
+
new
DateTimeConverter
().
dateFormat
()+
".xml"
);
fileWriter
.
write
(
new
VeManifestRelation
().
getMsg
(
landBusinessTypeList
));
fileWriter
.
flush
();
fileWriter
.
close
();
flag
=
true
;
}
catch
(
IOException
e
){
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 生成车单报文
* @param landBusinessTypeList
* @return
*/
public
String
getMsg
(
LandBusinessTypeList
landBusinessTypeList
){
StringBuffer
buffer
=
new
StringBuffer
();
buffer
.
append
(
"<CONTENT>"
);
buffer
.
append
(
"<VENAME>"
+
"</VENAME>"
);
buffer
.
append
(
"<MANIFESTS>"
);
String
[]
manifests
=
getManifests
(
landBusinessTypeList
.
getMasterList
());
for
(
String
manifest
:
manifests
){
buffer
.
append
(
"<MANIFEST>"
+
manifest
+
"</MANIFEST>"
);
}
buffer
.
append
(
"</MANIFESTS>"
);
buffer
.
append
(
"<STATION>"
+
landBusinessTypeList
.
getEndstation
()+
"</STATION>"
);
buffer
.
append
(
"<ASILE>"
+
landBusinessTypeList
.
getAisle
()+
"</ASILE>"
);
buffer
.
append
(
"<TYPE>"
+
landBusinessTypeList
.
getBusinesstype
()+
"</TYPE>"
);
buffer
.
append
(
"<OPTM>"
+
new
DateTimeConverter
().
dateFormat
()
+
"</OPTM>"
);
return
buffer
.
toString
();
}
public
String
[]
getManifests
(
String
manifest
){
return
manifest
.
split
(
","
);
}
}
...
...
src/main/java/com/sy/utils/DateTimeConverter.java
查看文件 @
d88f837
...
...
@@ -53,13 +53,11 @@ public class DateTimeConverter extends AbstractSingleValueConverter {
return
dateFormat
.
format
(
new
Date
());
}
public
static
String
dateFormat
()
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
return
simpleDateFormat
.
format
(
new
Date
());
public
String
dateFormat
()
{
return
dateFormat
.
format
(
new
Date
());
}
public
static
String
dateTimeFormat
()
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
return
simpleDateFormat
.
format
(
new
Date
());
public
String
dateTimeFormat
()
{
return
DATETIME_FORMAT
.
format
(
new
Date
());
}
public
static
String
getDay
()
{
return
date
.
format
(
new
Date
());
...
...
src/main/java/com/sy/utils/FileTool.java
查看文件 @
d88f837
...
...
@@ -65,7 +65,7 @@ public final class FileTool {
}
public
static
void
writeFileToBak
(
String
content
){
String
bakDir
=
readProperties
(
"
bak
Directory"
);
String
bakDir
=
readProperties
(
"
receive
Directory"
);
StringBuffer
stringBuffer
=
new
StringBuffer
();
stringBuffer
.
append
(
bakDir
).
append
(
"/"
).
append
(
UUIDCreate
.
getUUID
()).
append
(
".txt"
);
...
...
src/main/resources/generator/generatorConfig.xml
查看文件 @
d88f837
...
...
@@ -74,8 +74,13 @@
<!-- <table tableName="ResMessage" domainObjectName="RESMESSAGE" enableCountByExample="false"
enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
<table
tableName=
"entercancel"
domainObjectName=
"ENTERCANCCEL"
enableCountByExample=
"false"
<!--
<table tableName="entercancel" domainObjectName="ENTERCANCCEL" enableCountByExample="false"
enableUpdateByExample="false"
enableDeleteByExample=
"false"
enableSelectByExample=
"false"
selectByExampleQueryId=
"false"
></table>
enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">
</table>-->
<table
tableName=
"t_air_repertory"
domainObjectName=
"T_AIR_REPERTORY"
enableCountByExample=
"false"
enableUpdateByExample=
"false"
enableDeleteByExample=
"false"
enableSelectByExample=
"false"
selectByExampleQueryId=
"false"
>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
...
...
src/main/resources/mapping/LandBusinessTypeListMapper.xml
查看文件 @
d88f837
...
...
@@ -70,7 +70,7 @@
select
<include
refid=
"Base_Column_List"
/>
from land_businesstype_list
where BARCODE = #{barcode,jdbcType=VARCHAR}
where BARCODE = #{barcode,jdbcType=VARCHAR}
AND ISVALID = "0"
</select>
<select
id=
"selectMessageId"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
...
...
请
注册
或
登录
后发表评论