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
李俊
2023-06-13 13:39:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
db8ed9310e09816662a6686a17cb79dd55b34430
db8ed931
1 parent
2309a466
D类接口增加币制限制校验,提示用户不能用于申报而非币制不能为空
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
src/main/java/com/erry/iclear/dateInterface/api/CustomsDataInterface.java
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentService.java
src/main/java/com/erry/iclear/dateInterface/service/MawbService.java
src/main/java/com/erry/iclear/dateInterface/api/CustomsDataInterface.java
View file @
db8ed93
package
com
.
erry
.
iclear
.
dateInterface
.
api
;
import
com.erry.iclear.dateInterface.api.request.MawbDetail
;
import
com.erry.iclear.dateInterface.enums.ErrorCodeEnum
;
import
com.erry.iclear.dateInterface.api.request.Mawb
;
import
com.erry.iclear.dateInterface.api.response.ResultRS
;
...
...
@@ -115,6 +116,12 @@ public class CustomsDataInterface {
if
(!
result
.
getSuccess
()){
return
result
;
}
result
=
mawbService
.
checkCurrency
(
mawb
);
if
(!
result
.
getSuccess
()){
return
result
;
}
sw
.
stop
();
// //3、TODO 校验子单
...
...
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentService.java
View file @
db8ed93
package
com
.
erry
.
iclear
.
dateInterface
.
service
;
//import cn.hutool.core.date.DateUtil;
import
com.erry.iclear.dateInterface.api.request.MawbDetail
;
import
com.erry.iclear.dateInterface.enums.ErrorCodeEnum
;
import
com.erry.iclear.dateInterface.api.request.FedexMawb
;
import
com.erry.iclear.dateInterface.api.request.FedexReceipt
;
...
...
@@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
javax.transaction.Transactional
;
import
javax.validation.Valid
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
src/main/java/com/erry/iclear/dateInterface/service/MawbService.java
View file @
db8ed93
package
com
.
erry
.
iclear
.
dateInterface
.
service
;
import
com.erry.iclear.dateInterface.common.Constant
;
import
com.erry.iclear.dateInterface.entity.DictionaryEntries
;
import
com.erry.iclear.dateInterface.enums.ErrorCodeEnum
;
import
com.erry.iclear.dateInterface.api.request.Mawb
;
import
com.erry.iclear.dateInterface.api.request.MawbDetail
;
...
...
@@ -7,12 +9,14 @@ import com.erry.iclear.dateInterface.api.response.IClearCheckResult;
import
com.erry.iclear.dateInterface.api.response.ResultRS
;
import
com.erry.iclear.dateInterface.entity.ChmConsignment
;
import
com.erry.iclear.dateInterface.entity.ChmConsignmentDetail
;
import
com.erry.iclear.dateInterface.repository.DictionaryEntriesRepository
;
import
com.erry.iclear.dateInterface.repository.MawbRepository
;
import
com.erry.iclear.dateInterface.util.HttpUtils
;
import
com.erry.iclear.dateInterface.util.JsonToJava
;
import
com.erry.iclear.dateInterface.util.StringUtil
;
import
com.google.gson.Gson
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -40,6 +44,9 @@ public class MawbService {
@Autowired
private
ChmConsignmentDetailService
consignmentDetailService
;
@Autowired
private
DictionaryEntriesRepository
dictionaryEntriesRepository
;
/**
* 保存主单Request
* @param mawb
...
...
@@ -165,6 +172,51 @@ public class MawbService {
}
return
""
;
}
/**
* 检查成交币制在系统中是否有效 Constant.CURRENCY_SYSTEM+ mawbDetail.getTradeCurr();
* 成交币制 TradeCurr
* 杂费币制 OtherCurr
* 运费币制 FeeCurr
* 保费币制 InsurCurr
*
*/
public
ResultRS
checkCurrency
(
Mawb
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
)
)
||
(
StringUtils
.
isNotEmpty
(
otherCurr
)
&&
Objects
.
isNull
(
otherCurrDict
)
)
||
(
StringUtils
.
isNotEmpty
(
insurCurr
)
&&
Objects
.
isNull
(
insurCurrDict
)
)){
result
.
setSuccess
(
Boolean
.
FALSE
);
result
.
setCode
(
ErrorCodeEnum
.
ERROR_30001
.
getCode
());
result
.
setMsg
(
ErrorCodeEnum
.
ERROR_30001
.
getName
());
return
result
;
}
List
<
MawbDetail
>
mawbDetailList
=
mawb
.
getMawbDetailList
();
for
(
int
i
=
0
,
maxi
=
mawbDetailList
.
size
();
i
<
maxi
;
i
++)
{
MawbDetail
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_30001
.
getCode
());
result
.
setMsg
(
ErrorCodeEnum
.
ERROR_30001
.
getName
());
break
;
}
}
return
result
;
}
/**
* 校验主单
...
...
Please
register
or
login
to post a comment