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
李俊
2022-09-24 11:15:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5aaee6ddf451876b349b97bef766f7ab2b0c7e67
5aaee6dd
1 parent
3ffc7046
内网迁移环境代码调整
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
143 additions
and
17 deletions
src/main/java/com/erry/iclear/dateInterface/api/CustomsDataInterface.java
src/main/java/com/erry/iclear/dateInterface/api/request/FedexMawb.java
src/main/java/com/erry/iclear/dateInterface/api/request/Mawb.java
src/main/java/com/erry/iclear/dateInterface/service/IClearApiLogService.java
src/main/java/com/erry/iclear/dateInterface/service/MawbService.java
src/main/resources/application-dev.yml
src/main/webapp/WEB-INF/weblogic.xml
src/main/java/com/erry/iclear/dateInterface/api/CustomsDataInterface.java
View file @
5aaee6d
...
...
@@ -5,6 +5,7 @@ import com.erry.iclear.dateInterface.api.response.ResultRS;
import
com.erry.iclear.dateInterface.entity.IClearApiLog
;
import
com.erry.iclear.dateInterface.repository.MawbAdd
;
import
com.erry.iclear.dateInterface.service.*
;
import
com.erry.iclear.dateInterface.util.StringUtil
;
import
com.google.gson.Gson
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -55,6 +56,15 @@ public class CustomsDataInterface {
result
.
setMsg
(
"请求信息不能为空"
);
return
result
;
}
String
checkrs
=
mawbService
.
checkMawbBaseInfo
(
mawb
);
if
(
StringUtil
.
isNotEmpty
(
checkrs
)){
result
.
setCode
(
"-7"
);
result
.
setMsg
(
checkrs
);
return
result
;
}
//1、保存请求信息,保存到iClear的 SQLServer
StopWatch
sw
=
new
StopWatch
(
"receice mawb"
);
...
...
@@ -66,6 +76,8 @@ public class CustomsDataInterface {
IClearApiLog
saveIClearApiLogResult
=
iClearApiLogService
.
saveIClearApiLog
(
iClearApiLogService
.
convertToIClearApiLog
(
mawb
,
appId
,
appKey
,
new
Date
(
Long
.
valueOf
(
timeStamp
))));
mawb
.
setAppId
(
appId
);
if
(!
Objects
.
equals
(
saveIClearApiLogResult
,
null
)){
log
.
info
(
"请求保存成功,msgId:"
+
saveIClearApiLogResult
.
getMsgId
());
...
...
src/main/java/com/erry/iclear/dateInterface/api/request/FedexMawb.java
View file @
5aaee6d
...
...
@@ -8,6 +8,7 @@ import org.hibernate.annotations.DynamicUpdate;
import
javax.persistence.*
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
...
...
src/main/java/com/erry/iclear/dateInterface/api/request/Mawb.java
View file @
5aaee6d
...
...
@@ -50,12 +50,12 @@ public class Mawb implements Serializable {
private
String
type
;
@ApiModelProperty
(
value
=
"申报单位代码"
,
name
=
"agentCode"
,
example
=
"固定值:1111980005"
)
//
//
@NotBlank(message="参数agentCode不能为空")
//@NotBlank(message="参数agentCode不能为空")
@Column
(
name
=
"AGENTCODE"
)
private
String
agentCode
;
@ApiModelProperty
(
value
=
"申报单位名称"
,
name
=
"agentName"
,
example
=
"固定值:联邦快递(中国)有限公司"
)
//
//
@NotBlank(message="参数agentName不能为空")
//@NotBlank(message="参数agentName不能为空")
@Column
(
name
=
"AGENTNAME"
)
private
String
agentName
;
...
...
@@ -79,7 +79,7 @@ public class Mawb implements Serializable {
private
String
cutMode
;
@ApiModelProperty
(
value
=
"报关/转关关系标志"
,
name
=
"declTrnRel"
,
example
=
"固定值:0"
)
//
//
@NotBlank(message="参数declTrnRel不能为空")
//@NotBlank(message="参数declTrnRel不能为空")
@Column
(
name
=
"DECLTRNREL"
)
private
String
declTrnRel
;
...
...
@@ -89,7 +89,7 @@ public class Mawb implements Serializable {
private
String
distinatePort
;
@ApiModelProperty
(
value
=
"报关标志"
,
name
=
"EdiId"
,
example
=
"001"
)
//
//
@NotBlank(message="参数ediId不能为空")
//@NotBlank(message="参数ediId不能为空")
@Column
(
name
=
"EDIID"
)
private
String
ediId
;
...
...
@@ -98,12 +98,12 @@ 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
;
...
...
@@ -127,7 +127,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
;
...
...
@@ -228,7 +228,7 @@ public class Mawb implements Serializable {
private
String
markNo
;
@ApiModelProperty
(
value
=
"入境口岸代码"
,
name
=
"entyPortCode"
,
example
=
"固定值:110101"
)
//
//
@NotBlank(message="参数entyPortCode不能为空")
//@NotBlank(message="参数entyPortCode不能为空")
@Column
(
name
=
"ENTYPORTCODE"
)
private
String
entyPortCode
;
...
...
src/main/java/com/erry/iclear/dateInterface/service/IClearApiLogService.java
View file @
5aaee6d
...
...
@@ -2,14 +2,20 @@ package com.erry.iclear.dateInterface.service;
import
com.erry.iclear.dateInterface.api.request.Fedexc
;
import
com.erry.iclear.dateInterface.api.request.Mawb
;
import
com.erry.iclear.dateInterface.api.request.MawbDetail
;
import
com.erry.iclear.dateInterface.common.Constant
;
import
com.erry.iclear.dateInterface.entity.IClearApiLog
;
import
com.erry.iclear.dateInterface.repository.IClearApiLogRepository
;
import
com.erry.iclear.dateInterface.util.StringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotBlank
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
/**
* @author Administrator
...
...
src/main/java/com/erry/iclear/dateInterface/service/MawbService.java
View file @
5aaee6d
...
...
@@ -4,6 +4,7 @@ import com.arronlong.httpclientutil.HttpClientUtil;
import
com.arronlong.httpclientutil.common.HttpConfig
;
import
com.arronlong.httpclientutil.common.HttpHeader
;
import
com.erry.iclear.dateInterface.api.request.Mawb
;
import
com.erry.iclear.dateInterface.api.request.MawbDetail
;
import
com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult
;
import
com.erry.iclear.dateInterface.api.response.ResultRS
;
import
com.erry.iclear.dateInterface.entity.ChmConsignment
;
...
...
@@ -63,6 +64,113 @@ public class MawbService {
}
public
String
checkMawbBaseInfo
(
Mawb
mawb
){
if
(
StringUtil
.
isEmpty
(
mawb
.
getOverseasConsigneeEname
())){
return
"参数overseasConsigneeEname不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getEntyPortCode
())){
return
"参数entyPortCode不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getOwnerCodeScc
())){
return
"参数ownerCodeScc不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getTradeCodeScc
())){
return
"参数tradeCodeScc不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getTransMode
())){
return
"参数transMode不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getWrapType
())){
return
"参数wrapType不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getTradeName
())){
return
"参数tradeName不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getInsurCurr
())){
return
"参数insurCurr不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getIePort
())){
return
"参数iePort不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getFeeMark
())){
return
"参数feeMark不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getFeeCurr
())){
return
"参数feeCurr不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getEdiId
())){
return
"参数ediId不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getDistinatePort
())){
return
"参数distinatePort不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getDeclTrnRel
())){
return
"参数declTrnRel不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getCutMode
())){
return
"参数cutMode不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getCustomMaster
())){
return
"参数customMaster不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getBillNo
())){
return
"参数billNo不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getAgentName
())){
return
"参数agentName不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawb
.
getAgentCode
())){
return
"参数agentCode不能为空"
;
}
List
<
MawbDetail
>
mawbDetailList
=
mawb
.
getMawbDetailList
();
if
(
Objects
.
nonNull
(
mawbDetailList
)){
for
(
int
i
=
0
,
maxi
=
mawbDetailList
.
size
();
i
<
maxi
;
i
++)
{
MawbDetail
mawbDetail
=
mawbDetailList
.
get
(
i
);
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getDetailId
())){
return
"参数detailId不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getCodeTS
())){
return
"参数codeTS不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getDutyMode
())){
return
"参数dutyMode不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getFirstUnit
())){
return
"参数firstUnit不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getGunit
())){
return
"参数gunit不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getGmodel
())){
return
"参数gmodel不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getGname
())){
return
"参数gname不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getGno
())){
return
"参数gno不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getOriginCountry
())){
return
"参数originCountry不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getTradeCurr
())){
return
"参数tradeCurr不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getDestinationCountry
())){
return
"参数destinationCountry不能为空"
;
}
if
(
StringUtil
.
isEmpty
(
mawbDetail
.
getDistrictCode
())){
return
"参数districtCode不能为空"
;
}
}
}
return
""
;
}
/**
* 校验主单
* @param mawb
...
...
src/main/resources/application-dev.yml
View file @
5aaee6d
...
...
@@ -13,13 +13,13 @@ spring:
task
:
#推送海关回执
pushCustomsTask
:
0 0/1 *
*
* ?
pushCustomsTask
:
0 0/1 *
1
* ?
#推送完整报文
pushMawbTask
:
0 0/1 *
*
* ?
pushMawbTask
:
0 0/1 *
1
* ?
#推送失败的回执数据
pushErrorReturnDate
:
0 0/3 *
*
* ?
pushErrorReturnDate
:
0 0/3 *
1
* ?
#推送失败的申报数据
pushErrorDeclareDate
:
0 0/3 *
*
* ?
pushErrorDeclareDate
:
0 0/3 *
1
* ?
#推送地址
api
:
...
...
src/main/webapp/WEB-INF/weblogic.xml
View file @
5aaee6d
...
...
@@ -6,9 +6,8 @@
<!-- 访问路径 -->
<wls:context-root>
API
</wls:context-root>
<!-- 优先加载WEB-INF下lib中的jar包 -->
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>
org.slf4j
</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
<!-- <wls:container-descriptor>-->
<!-- <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>-->
<!-- </wls:container-descriptor>-->
</wls:weblogic-web-app>
...
...
Please
register
or
login
to post a comment