Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-Connect-Pre-Clearance
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tao.mo
2024-11-05 19:15:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0dc4ec58eb1eac2303428b5675d8e855c0cc71bb
0dc4ec58
1 parent
c8f0b3ab
All | 修改 | 处理ce501数据调整
mt 2024年11月5日19:15:18
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
20 deletions
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/config/CacheSystem.java
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/contants/BaseConstants.java
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/contants/DictionaryConstants.java
server/kafka-cndc-server/src/main/java/com/fedex/connect/kafka/constants/Constant.java
server/kafka-cndc-server/src/main/java/com/fedex/connect/kafka/util/Dm501Util.java
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/config/CacheSystem.java
View file @
0dc4ec5
...
...
@@ -54,8 +54,8 @@ public class CacheSystem implements CommandLineRunner {
/**
* @Author mt
* @Description 获取目录层级下所有目录
* @Date 2024
/11/4
* @Description
根据dicCode
获取目录层级下所有目录
* @Date 2024
年11月5日18:38:28
* @param dicCode
* @return java.util.List<com.fedex.connect.common.model.bi.DictionaryEntries>
*/
...
...
@@ -65,8 +65,8 @@ public class CacheSystem implements CommandLineRunner {
/**
* @Author mt
* @Description 获取用户类型指定字典项
* @Date 2024
/11/4
* @Description
根据code
获取用户类型指定字典项
* @Date 2024
年11月5日18:38:28
* @param code
* @return com.fedex.connect.common.model.bi.DictionaryEntries
*/
...
...
@@ -77,8 +77,8 @@ public class CacheSystem implements CommandLineRunner {
/**
* @Author mt
* @Description 获取运单状态指定字典项
* @Date 2024
/11/4
* @Description
根据code
获取运单状态指定字典项
* @Date 2024
年11月5日18:38:28
* @param code
* @return com.fedex.connect.common.model.bi.DictionaryEntries
*/
...
...
@@ -86,5 +86,28 @@ public class CacheSystem implements CommandLineRunner {
List
<
DictionaryEntries
>
filter
=
dictionaryMap
.
get
(
DictionaryConstants
.
CONSIGNMENT_STATUS
).
stream
().
filter
(
p
->
code
.
equals
(
p
.
getCode
())).
collect
(
Collectors
.
toList
());
return
filter
.
isEmpty
()
?
null
:
filter
.
get
(
DigitConstants
.
DIGIT_ZERO
);
}
}
/**
* @Author mt
* @Description 根据code获取国家指定字典项
* @Date 2024年11月5日18:38:28
* @param code
* @return com.fedex.connect.common.model.bi.DictionaryEntries
*/
public
DictionaryEntries
getDicCountry
(
String
code
){
List
<
DictionaryEntries
>
filter
=
dictionaryMap
.
get
(
DictionaryConstants
.
COUNTRY
).
stream
().
filter
(
p
->
code
.
equals
(
p
.
getCode
())).
collect
(
Collectors
.
toList
());
return
filter
.
isEmpty
()
?
null
:
filter
.
get
(
DigitConstants
.
DIGIT_ZERO
);
}
/**
* @Author mt
* @Description 根据ext1获取国家指定字典项
* @Date 2024/11/5
* @param ext1
* @return com.fedex.connect.common.model.bi.DictionaryEntries
*/
public
DictionaryEntries
getDicCountryByExt1
(
String
ext1
){
List
<
DictionaryEntries
>
filter
=
dictionaryMap
.
get
(
DictionaryConstants
.
COUNTRY
).
stream
().
filter
(
p
->
ext1
.
equals
(
p
.
getExt1
())).
collect
(
Collectors
.
toList
());
return
filter
.
isEmpty
()
?
null
:
filter
.
get
(
DigitConstants
.
DIGIT_ZERO
);
}
}
\ No newline at end of file
...
...
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/contants/BaseConstants.java
View file @
0dc4ec5
...
...
@@ -22,5 +22,15 @@ public interface BaseConstants {
String
MODIFY_USER_NAME
=
"modifyUserName"
;
}
//运单表基础字段
interface
CONSIGNMENT_TABLE_COLUMN_KEYS
{
//预计取件时间
String
SHIP_DATE
=
"shipDate"
;
//原产国全称
String
ORIGIN_COUNTRY
=
"originCountry"
;
//发货人计费账号
String
SHIPPER_ACCOUNT
=
"shipperAccount"
;
//目的国全称
String
DESTINATION_COUNTRY
=
"destinationCountry"
;
}
}
\ No newline at end of file
...
...
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/contants/DictionaryConstants.java
View file @
0dc4ec5
...
...
@@ -10,4 +10,6 @@ public interface DictionaryConstants {
String
CONSIGNMENT_STATUS
=
"CONSIGNMENT_STATUS"
;
//用户类型
String
USER_TYPE
=
"USER_TYPE"
;
//国家
String
COUNTRY
=
"COUNTRY"
;
}
...
...
server/kafka-cndc-server/src/main/java/com/fedex/connect/kafka/constants/Constant.java
View file @
0dc4ec5
package
com
.
fedex
.
connect
.
kafka
.
constants
;
import
com.fedex.connect.common.dependencies.contants.BaseConstants
;
/**
* @Author mt
* @Description 类说明 常量接口
...
...
@@ -39,11 +41,26 @@ public interface Constant {
//代理人
String
BROKEN
=
"BROKEN"
;
}
//
地址类型常量
//
收发件人国家二字码
interface
CE_INFO_KEYS
{
//发件人国家
String
TW
=
"TW"
;
//收件人国家
String
CN
=
"CN"
;
}
//ceInfo转换为consignment忽略字段
interface
CE_CONSIGNMENT_COPY_IGNORE_PROP_KEYS
{
String
[]
IGNORE_PROPERTIES
=
{
BaseConstants
.
CONSIGNMENT_TABLE_COLUMN_KEYS
.
SHIP_DATE
,
BaseConstants
.
CONSIGNMENT_TABLE_COLUMN_KEYS
.
ORIGIN_COUNTRY
,
BaseConstants
.
CONSIGNMENT_TABLE_COLUMN_KEYS
.
SHIPPER_ACCOUNT
,
BaseConstants
.
CONSIGNMENT_TABLE_COLUMN_KEYS
.
DESTINATION_COUNTRY
,
BaseConstants
.
BASE_TABLE_COLUMN_KEYS
.
CREATE_TIME
,
BaseConstants
.
BASE_TABLE_COLUMN_KEYS
.
CREATE_USER_ID
,
BaseConstants
.
BASE_TABLE_COLUMN_KEYS
.
CREATE_USER_NAME
,
BaseConstants
.
BASE_TABLE_COLUMN_KEYS
.
MODIFY_TIME
,
BaseConstants
.
BASE_TABLE_COLUMN_KEYS
.
MODIFY_USER_ID
,
BaseConstants
.
BASE_TABLE_COLUMN_KEYS
.
MODIFY_USER_NAME
,
};
}
}
...
...
server/kafka-cndc-server/src/main/java/com/fedex/connect/kafka/util/Dm501Util.java
View file @
0dc4ec5
...
...
@@ -121,12 +121,17 @@ public class Dm501Util {
* @return void
*/
private
void
generateCeInfoShipper
(
CeInfo
ceInfo
,
Dm501ConAddresses
shipperAddress
){
//发件人国家
//发件人国家
(二字码)
String
shipperCountry
=
shipperAddress
.
getCountry
();
//始发国(二字码)
ceInfo
.
setShipperCountry
(
shipperCountry
);
//根据发件人国家二字码获取字典
DictionaryEntries
shipperCountryEntries
=
cacheSystem
.
getDicCountryByExt1
(
shipperCountry
);
//根据二字码能获取到二字码则赋值始发国全称
if
(
Objects
.
nonNull
(
shipperCountryEntries
)){
//原产国全称
// ceInfo.setOriginCountry();
ceInfo
.
setOriginCountry
(
shipperCountryEntries
.
getEnglishName
());
}
//发货联系人姓名
ceInfo
.
setShipperContactName
(
shipperAddress
.
getContactName
());
//发货人手机号
...
...
@@ -157,8 +162,13 @@ public class Dm501Util {
String
recipientCountry
=
recipientAddress
.
getCountry
();
// //目的国家二字码
ceInfo
.
setRecipientCountry
(
recipientCountry
);
//根据发件人国家二字码获取字典
DictionaryEntries
countryEntries
=
cacheSystem
.
getDicCountryByExt1
(
recipientCountry
);
//根据二字码能获取到二字码则赋值目的国全称
if
(
Objects
.
nonNull
(
countryEntries
)){
//目的国全称
// ceInfo.setDestinationCountry();
ceInfo
.
setDestinationCountry
(
countryEntries
.
getEnglishName
());
}
//收件联系人姓名
ceInfo
.
setRecipientContactName
(
recipientAddress
.
getContactName
());
//收件人手机号
...
...
@@ -185,7 +195,7 @@ public class Dm501Util {
* @return com.fedex.connect.common.model.biz.Consignment
*/
public
Consignment
generateConsignment
(
CeInfo
ceInfo
)
throws
Exception
{
Consignment
rsConsignment
=
null
;
Consignment
rsConsignment
;
/**
* 根据运单号查找30天之前运单
*/
...
...
@@ -203,15 +213,12 @@ public class Dm501Util {
AssignmentFieldUtils
.
assignmentTableBaseField
(
resultConsignment
);
rsConsignment
=
resultConsignment
;
}
else
{
//原产国全称
// String originCountry = consignment.getOriginCountry();
//发货人国家二字码
// String shipperCountry = consignment.getShipperCountry();
BeanUtils
.
copyProperties
(
ceInfo
,
consignment
);
//ceInfo转换为consignment忽略字段
String
[]
ignoreProperties
=
Constant
.
CE_CONSIGNMENT_COPY_IGNORE_PROP_KEYS
.
IGNORE_PROPERTIES
;
//字段拷贝
BeanUtils
.
copyProperties
(
ceInfo
,
consignment
,
ignoreProperties
);
rsConsignment
=
consignment
;
}
return
rsConsignment
;
}
...
...
Please
register
or
login
to post a comment