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
tao.mo
2022-07-15 18:01:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6d573d66f464e686d4c7bef017cf01585ffc1a44
6d573d66
1 parent
8e02c2bb
西门子运单,成交方式为FOB时,运费为空,被接口校验退回。这里只有在成交方式为CIF时运费才是必填项
mt 2022年7月15日18:01:11
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
5 deletions
doc/FedEx在线申报系统API - 数据推送接口(D类).docx
src/main/java/com/erry/iclear/dateInterface/api/request/Mawb.java
src/main/java/com/erry/iclear/dateInterface/service/MawbService.java
doc/FedEx在线申报系统API - 数据推送接口(D类).docx
View file @
6d573d6
No preview for this file type
src/main/java/com/erry/iclear/dateInterface/api/request/Mawb.java
View file @
6d573d6
...
...
@@ -100,17 +100,17 @@ public class Mawb implements Serializable {
private
String
entryId
;
@ApiModelProperty
(
value
=
"运费币制"
,
name
=
"feeCurr"
,
example
=
"固定值:3"
)
@NotBlank
(
message
=
"参数feeCurr不能为空"
)
//
@NotBlank(message="参数feeCurr不能为空")
@Column
(
name
=
"FEECURR"
)
private
String
feeCurr
;
@ApiModelProperty
(
value
=
"运费标记"
,
name
=
"feeMark"
,
example
=
"99.22"
)
@NotBlank
(
message
=
"参数feeMark不能为空"
)
//
@NotBlank(message="参数feeMark不能为空")
@Column
(
name
=
"FEEMARK"
)
private
String
feeMark
;
@ApiModelProperty
(
value
=
"运费/率"
,
name
=
"feeRate"
,
example
=
"43.34358"
)
@NotNull
(
message
=
"参数feeRate不能为空"
)
//
@NotNull(message="参数feeRate不能为空")
@Column
(
name
=
"FEERATE"
)
private
BigDecimal
feeRate
;
...
...
@@ -129,7 +129,7 @@ public class Mawb implements Serializable {
private
String
inputerName
;
@ApiModelProperty
(
value
=
"保险费币制"
,
name
=
"insurCurr"
,
example
=
"MOP"
)
@NotBlank
(
message
=
"参数insurCurr不能为空"
)
//
@NotBlank(message="参数insurCurr不能为空")
@Column
(
name
=
"INSURCURR"
)
private
String
insurCurr
;
...
...
@@ -138,7 +138,7 @@ public class Mawb implements Serializable {
private
String
insurMark
;
@ApiModelProperty
(
value
=
"保险费/率"
,
name
=
"insurRate"
,
example
=
""
)
@NotNull
(
message
=
"参数insurRate不能为空"
)
//
@NotNull(message="参数insurRate不能为空")
@Column
(
name
=
"INSURRATE"
)
private
BigDecimal
insurRate
;
...
...
src/main/java/com/erry/iclear/dateInterface/service/MawbService.java
View file @
6d573d6
...
...
@@ -10,6 +10,7 @@ import com.erry.iclear.dateInterface.entity.ChmConsignment;
import
com.erry.iclear.dateInterface.entity.ChmConsignmentDetail
;
import
com.erry.iclear.dateInterface.repository.MawbRepository
;
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.http.Header
;
...
...
@@ -78,6 +79,12 @@ public class MawbService {
result
.
setMsg
(
"数据格式不正确"
);
return
result
;
}
//校验成交方式 成交方式为CIF时 '参数feeCurr不能为空','参数feeMark不能为空'',参数feeRate不能为空','参数insurCurr不能为空', '参数insurRate不能为空'
result
=
this
.
notBlankCheck
(
mawb
,
chmConsignment
.
getDealMode
());
if
(!
result
.
getSuccess
()){
return
result
;
}
List
<
ChmConsignmentDetail
>
chmConsignmentDetailList
=
new
ArrayList
<>();
mawb
.
getMawbDetailList
().
forEach
(
detail
->{
chmConsignmentDetailList
.
add
(
consignmentDetailService
.
convertToChmConsignmentDetail
(
detail
,
chmConsignment
));
...
...
@@ -107,4 +114,39 @@ public class MawbService {
}
return
result
;
}
/**
* 校验成交方式 成交方式为CIF时 '参数feeCurr不能为空','参数feeMark不能为空'',参数feeRate不能为空','参数insurCurr不能为空', '参数insurRate不能为空'
* @param mawb
* @param dealMode 转换过的成交方式
* @return
*/
private
ResultRS
notBlankCheck
(
Mawb
mawb
,
String
dealMode
)
{
ResultRS
result
=
new
ResultRS
(
Boolean
.
TRUE
,
null
,
null
);
//成交方式为CIF时 '参数feeCurr不能为空','参数feeMark不能为空'',参数feeRate不能为空','参数insurCurr不能为空', '参数insurRate不能为空'
if
(
dealMode
.
equals
(
"CIF"
)){
if
(
StringUtil
.
isEmpty
(
mawb
.
getFeeCurr
())){
result
.
setSuccess
(
false
);
result
.
setCode
(
"30002"
);
result
.
setMsg
(
"运费币制不能为空"
);
}
else
if
(
StringUtil
.
isEmpty
(
mawb
.
getFeeMark
())){
result
.
setSuccess
(
false
);
result
.
setCode
(
"30002"
);
result
.
setMsg
(
"运费标记不能为空"
);
}
else
if
(
mawb
.
getFeeRate
()
==
null
){
result
.
setSuccess
(
false
);
result
.
setCode
(
"30002"
);
result
.
setMsg
(
"运费/率不能为空"
);
}
else
if
(
StringUtil
.
isEmpty
(
mawb
.
getInsurCurr
())){
result
.
setSuccess
(
false
);
result
.
setCode
(
"30002"
);
result
.
setMsg
(
"保险费币制不能为空"
);
}
else
if
(
mawb
.
getInsurRate
()
==
null
){
result
.
setSuccess
(
false
);
result
.
setCode
(
"30002"
);
result
.
setMsg
(
"保险费/率不能为空"
);
}
}
return
result
;
}
}
...
...
Please
register
or
login
to post a comment