Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-api
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
Jun.li
2023-07-20 15:54:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e023b46928d934bcc385df0377beabdea23a9329
e023b469
1 parent
01423e3d
D类币值校验接口 币值不在系统22个币制范围内时候 提示“此申报币制不在海关要求的范围内 请修改!”
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
1 deletions
src/main/java/com/erry/iclear/dateInterface/api/FedexDataInterface.java
src/main/java/com/erry/iclear/dateInterface/service/MawbService.java
src/main/java/com/erry/iclear/dateInterface/api/FedexDataInterface.java
View file @
e023b46
...
...
@@ -36,6 +36,9 @@ public class FedexDataInterface {
private
FedexService
fedexService
;
@Autowired
private
MawbService
mawbService
;
@Autowired
private
ChmConsignmentService
chmConsignmentService
;
@Autowired
...
...
@@ -98,6 +101,12 @@ public class FedexDataInterface {
sw
.
start
(
"generate FedexMawb"
);
fedexc
.
setAppId
(
appId
);
FedexMawb
saveMawbFedexResult
=
fedexService
.
generateFedexMawb
(
fedexc
);
//检验运单币制是否有效
ResultRS
resultRS
=
mawbService
.
checkCurrency
(
saveMawbFedexResult
);
if
(!
resultRS
.
getSuccess
()){
return
resultRS
;
}
sw
.
stop
();
sw
.
start
(
"checkFedexMawb"
);
...
...
@@ -186,6 +195,12 @@ public class FedexDataInterface {
}
sw
.
stop
();
//检验运单币制是否有效
ResultRS
resultRS
=
mawbService
.
checkCurrency
(
saveMawbFedexResult
);
if
(!
resultRS
.
getSuccess
()){
return
resultRS
;
}
// //3、TODO 校验子单
// sw.start("checkMawbDetail");
// result=mawbDetailServicel.checkMawbDetail(mawb);
...
...
@@ -359,4 +374,4 @@ public class FedexDataInterface {
result
.
setCode
(
ErrorCodeEnum
.
SUCCESS
.
getCode
());
return
result
;
}
}
\ No newline at end of file
}
...
...
src/main/java/com/erry/iclear/dateInterface/service/MawbService.java
View file @
e023b46
package
com
.
erry
.
iclear
.
dateInterface
.
service
;
import
com.erry.iclear.dateInterface.api.request.FedexMawb
;
import
com.erry.iclear.dateInterface.api.request.FedexMawbDetail
;
import
com.erry.iclear.dateInterface.common.Constant
;
import
com.erry.iclear.dateInterface.entity.DictionaryEntries
;
import
com.erry.iclear.dateInterface.enums.ErrorCodeEnum
;
...
...
@@ -21,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
javax.validation.Valid
;
import
java.util.*
;
/**
...
...
@@ -232,7 +235,66 @@ public class MawbService {
return
result
;
}
/**
* 检查成交币制在系统中是否有效 Constant.CURRENCY_SYSTEM+ mawbDetail.getTradeCurr();
* 成交币制 TradeCurr
* 杂费币制 OtherCurr
* 运费币制 FeeCurr
* 保费币制 InsurCurr
*
*/
public
ResultRS
checkCurrency
(
FedexMawb
mawb
){
ResultRS
result
=
new
ResultRS
(
Boolean
.
TRUE
,
null
,
null
,
null
);
String
feeCurr
=
mawb
.
getFeeCurr
();
DictionaryEntries
feeCurrDict
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
CURRENCY_SYSTEM
+
feeCurr
);
String
otherCurr
=
mawb
.
getOtherCurr
();
DictionaryEntries
otherCurrDict
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
CURRENCY_SYSTEM
+
otherCurr
);
String
insurCurr
=
mawb
.
getInsurCurr
();
DictionaryEntries
insurCurrDict
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
CURRENCY_SYSTEM
+
insurCurr
);
//运费币制检查
if
(
StringUtils
.
isNotEmpty
(
feeCurr
)
&&
Objects
.
isNull
(
feeCurrDict
)
){
result
.
setSuccess
(
Boolean
.
FALSE
);
result
.
setCode
(
ErrorCodeEnum
.
ERROR_30106
.
getCode
());
result
.
setMsg
(
ErrorCodeEnum
.
ERROR_30106
.
getName
().
replace
(
"{columnName}"
,
"运费"
));
return
result
;
}
//杂费币制检查
if
(
StringUtils
.
isNotEmpty
(
otherCurr
)
&&
Objects
.
isNull
(
otherCurrDict
)
){
result
.
setSuccess
(
Boolean
.
FALSE
);
result
.
setCode
(
ErrorCodeEnum
.
ERROR_30106
.
getCode
());
result
.
setMsg
(
ErrorCodeEnum
.
ERROR_30106
.
getName
().
replace
(
"{columnName}"
,
"杂费"
));
return
result
;
}
//保费币制检查
if
(
StringUtils
.
isNotEmpty
(
insurCurr
)
&&
Objects
.
isNull
(
insurCurrDict
)
){
result
.
setSuccess
(
Boolean
.
FALSE
);
result
.
setCode
(
ErrorCodeEnum
.
ERROR_30106
.
getCode
());
result
.
setMsg
(
ErrorCodeEnum
.
ERROR_30106
.
getName
().
replace
(
"{columnName}"
,
"保费"
));
return
result
;
}
//申报币制检查
List
<
FedexMawbDetail
>
mawbDetailList
=
mawb
.
getMawbDetailList
();
for
(
int
i
=
0
,
maxi
=
mawbDetailList
.
size
();
i
<
maxi
;
i
++)
{
FedexMawbDetail
mawbDetail
=
mawbDetailList
.
get
(
i
);
String
tradeCurr
=
mawbDetail
.
getTradeCurr
();
DictionaryEntries
tradeCurrDict
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
CURRENCY_SYSTEM
+
tradeCurr
);
if
((
StringUtils
.
isNotEmpty
(
tradeCurr
)
&&
Objects
.
isNull
(
tradeCurrDict
))){
result
.
setSuccess
(
Boolean
.
FALSE
);
result
.
setCode
(
ErrorCodeEnum
.
ERROR_30106
.
getCode
());
result
.
setMsg
(
ErrorCodeEnum
.
ERROR_30106
.
getName
().
replace
(
"{columnName}"
,
""
));
break
;
}
}
return
result
;
}
/**
* 校验主单
...
...
Please
register
or
login
to post a comment