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
wei.zhou
2021-06-21 21:30:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
af9eae284766d4c2a245fa243567010de26f829e
af9eae28
1 parent
a7f60894
提交代码
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
268 additions
and
57 deletions
src/main/java/com/erry/iclear/dateInterface/IClearApiApplication.java
src/main/java/com/erry/iclear/dateInterface/api/CustomsDataInterface.java
src/main/java/com/erry/iclear/dateInterface/api/request/MawbDetail.java
src/main/java/com/erry/iclear/dateInterface/common/Constant.java
src/main/java/com/erry/iclear/dateInterface/entity/ChmConsignment.java
src/main/java/com/erry/iclear/dateInterface/entity/ChmConsignmentDetail.java
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentDetailService.java
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentService.java
src/main/java/com/erry/iclear/dateInterface/service/SimpleJpaRepositoryImpl.java
src/test/java/com/erry/iclear/dateInterface/ApiTest.java
src/test/java/com/erry/iclear/dateInterface/ChmConsignmentServiceTest.java
src/test/java/com/erry/iclear/dateInterface/SHA256Test.java
src/main/java/com/erry/iclear/dateInterface/IClearApiApplication.java
View file @
af9eae2
package
com
.
erry
.
iclear
.
dateInterface
;
import
com.erry.iclear.dateInterface.service.SimpleJpaRepositoryImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.data.jpa.repository.config.EnableJpaRepositories
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
...
...
@@ -13,6 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@Slf4j
@SpringBootApplication
@EnableScheduling
//@EnableJpaRepositories(value = "com.erry.iclear.dateInterface.repository", repositoryBaseClass = SimpleJpaRepositoryImpl.class)
public
class
IClearApiApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/com/erry/iclear/dateInterface/api/CustomsDataInterface.java
View file @
af9eae2
...
...
@@ -108,9 +108,9 @@ public class CustomsDataInterface {
//4、保存运单到iclear中
sw
.
start
(
"saveToIClear"
);
if
(
result
.
getSuccess
()
){
sw
.
start
(
"processChmConsignment"
);
//if(result.getSuccess()){
if
(
true
){
chmConsignmentService
.
processChmConsignment
(
mawb
,
timeStamp
);
}
sw
.
stop
();
...
...
src/main/java/com/erry/iclear/dateInterface/api/request/MawbDetail.java
View file @
af9eae2
package
com
.
erry
.
iclear
.
dateInterface
.
api
.
request
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -32,102 +33,127 @@ public class MawbDetail implements Serializable {
@ApiModelProperty
(
value
=
"商品编号"
,
example
=
"空值"
)
@Column
(
name
=
"CLASSMARK"
)
//JsonProperty("ClassMark")
private
String
classMark
;
@ApiModelProperty
(
value
=
"商品编号"
)
@Column
(
name
=
"CODETS"
)
//@JsonProperty("CodeTS")
private
String
codeTS
;
@ApiModelProperty
(
value
=
"申报单价"
,
example
=
"空值"
)
@Column
(
name
=
"DECLPRICE"
)
//@JsonProperty("DeclPrice")
private
BigDecimal
declPrice
;
@ApiModelProperty
(
value
=
"申报总价"
)
@Column
(
name
=
"DECLTOTAL"
)
//@JsonProperty("DeclTotal")
private
BigDecimal
declTotal
;
@ApiModelProperty
(
value
=
"征免方式"
)
@Column
(
name
=
"DUTYMODE"
)
//@JsonProperty("DutyMode")
private
String
dutyMode
;
@ApiModelProperty
(
value
=
"货号"
)
@Column
(
name
=
"EXGNO"
)
//@JsonProperty("ExgNo")
private
String
exgNo
;
@ApiModelProperty
(
value
=
"货号"
)
@Column
(
name
=
"EXGVERSION"
)
//@JsonProperty("ExgVersion")
private
String
exgVersion
;
@ApiModelProperty
(
value
=
"第一计量单位(法定单位)"
)
@Column
(
name
=
"FIRSTUNIT"
)
//@JsonProperty("FirstUnit")
private
String
firstUnit
;
@ApiModelProperty
(
value
=
"第一法定数量"
)
@Column
(
name
=
"FIRSTQTY"
)
//@JsonProperty("FirstQty")
private
Integer
firstQty
;
@ApiModelProperty
(
value
=
"成交计量单位"
)
@Column
(
name
=
"GUNIT"
)
private
String
GUnit
;
//@JsonProperty("GUNIT")
private
String
gunit
;
@ApiModelProperty
(
value
=
"商品规格、型号"
)
@Column
(
name
=
"GMODE"
)
private
String
GModel
;
//@JsonProperty("GModel")
private
String
gmodel
;
@ApiModelProperty
(
value
=
"商品名称"
)
@Column
(
name
=
"GNAME"
)
private
String
GName
;
//@JsonProperty("GName")
private
String
gname
;
@ApiModelProperty
(
value
=
"商品序号"
)
@Column
(
name
=
"GNO"
)
private
String
GNo
;
//@JsonProperty("GNo")
private
String
gno
;
@ApiModelProperty
(
value
=
"成交数量"
)
@Column
(
name
=
"GQTY"
)
private
Integer
GQty
;
//@JsonProperty("GQty")
private
BigDecimal
gqty
;
@ApiModelProperty
(
value
=
"原产国"
)
@Column
(
name
=
"ORIGINCURRENTY"
)
//@JsonProperty("OriginCountry")
private
String
originCountry
;
@ApiModelProperty
(
value
=
"第二计量单位"
)
@Column
(
name
=
"SECONDUNIT"
)
//@JsonProperty("SecondUnit")
private
String
secondUnit
;
@ApiModelProperty
(
value
=
"第二法定数量"
)
@Column
(
name
=
"SECONDQTY"
)
//@JsonProperty("SecondQty")
private
Integer
secondQty
;
@ApiModelProperty
(
value
=
"成交币制"
)
@Column
(
name
=
"TRADECURR"
)
//@JsonProperty("TradeCurr")
private
String
tradeCurr
;
@ApiModelProperty
(
value
=
"用途/生产厂家"
)
@Column
(
name
=
"USETO"
)
//@JsonProperty("UseTo")
private
String
useTo
;
@ApiModelProperty
(
value
=
"工缴费"
)
@Column
(
name
=
"WORKUSD"
)
//@JsonProperty("WorkUsd")
private
BigDecimal
workUsd
;
@ApiModelProperty
(
value
=
"检验检疫编"
)
@Column
(
name
=
"CIQCODE"
)
//@JsonProperty("CiqCode")
private
String
ciqCode
;
@ApiModelProperty
(
value
=
"最终目的国(地区)"
)
@Column
(
name
=
"DESTINATIONCOUNTRY"
)
//@JsonProperty("DestinationCountry")
private
String
destinationCountry
;
@ApiModelProperty
(
value
=
"申报货物英文名称"
)
@Column
(
name
=
"DECLGOODSENAME"
)
//@JsonProperty("DeclGoodsEname")
private
String
declGoodsEname
;
@ApiModelProperty
(
value
=
"目的地代码"
)
@Column
(
name
=
"DESTCODE"
)
//@JsonProperty("DestCode")
private
String
destCode
;
@ApiModelProperty
(
value
=
"境内目的地/境内货源地"
)
@Column
(
name
=
"DISTRICTCODE"
)
//@JsonProperty("DistrictCode")
private
String
districtCode
;
...
...
src/main/java/com/erry/iclear/dateInterface/common/Constant.java
View file @
af9eae2
...
...
@@ -33,7 +33,7 @@ public class Constant {
public
static
String
MSG_TYPE_D
=
"D"
;
//
public static String LEVY_TYPE="levyType_";
public
static
String
LEVY_TYPE
=
"levyType_"
;
public
static
String
TRANSACTION_UNIT
=
"transactionUnit_"
;
...
...
src/main/java/com/erry/iclear/dateInterface/entity/ChmConsignment.java
View file @
af9eae2
...
...
@@ -39,6 +39,14 @@ public class ChmConsignment implements Serializable {
@JoinColumn
(
name
=
"DECLARED_DOC_TYPE_ID"
)
private
DictionaryEntries
declaredDocTypeDic
;
/**
* 乐观锁
*/
// @Version
// @Column(name = "VERSION", columnDefinition = "INTEGER", length = 8)
// private Integer version;
/**
* 报关单类型
*/
...
...
@@ -973,8 +981,9 @@ public class ChmConsignment implements Serializable {
private
String
isBatchimport
;
@OneToMany
(
cascade
=
CascadeType
.
PERSIST
)
@JoinColumn
(
name
=
"CONSIGNMENT_ID"
)
@OneToMany
(
mappedBy
=
"chmConsignment"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
ChmConsignmentDetail
>
chmConsignmentDetailList
;
...
...
src/main/java/com/erry/iclear/dateInterface/entity/ChmConsignmentDetail.java
View file @
af9eae2
...
...
@@ -30,13 +30,14 @@ public class ChmConsignmentDetail implements Serializable {
/**
* 运单
*/
@ManyToOne
(
targetEntity
=
ChmConsignment
.
class
)
@JoinColumn(name = "CONSIGNMENT_ID")
@JoinColumn
(
name
=
"CONSIGNMENT_ID"
,
updatable
=
false
)
private
ChmConsignment
chmConsignment
;
*/
@Column
(
name
=
"CONSIGNMENT_ID"
)
private
Integer
consignmentId
;
// @Column(name = "CONSIGNMENT_ID")
// private Long consignmentId;
/**
* 商品编号CodeTS
...
...
@@ -254,7 +255,7 @@ public class ChmConsignmentDetail implements Serializable {
public
String
toString
()
{
return
"ChmConsignmentDetail{"
+
"id="
+
id
+
", consignmentId="
+
c
onsignmentId
+
", consignmentId="
+
c
hmConsignment
.
getId
()
+
", skuCode='"
+
skuCode
+
'\''
+
", skuName='"
+
skuName
+
'\''
+
", model='"
+
model
+
'\''
+
...
...
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentDetailService.java
View file @
af9eae2
...
...
@@ -3,11 +3,16 @@ package com.erry.iclear.dateInterface.service;
import
com.erry.iclear.dateInterface.api.request.MawbDetail
;
import
com.erry.iclear.dateInterface.common.Constant
;
import
com.erry.iclear.dateInterface.entity.*
;
import
com.erry.iclear.dateInterface.repository.ChmConsignmentDetailRepository
;
import
com.erry.iclear.dateInterface.repository.ChmConsignmentRepository
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
/**
...
...
@@ -18,14 +23,20 @@ import java.util.Objects;
public
class
ChmConsignmentDetailService
{
@Autowired
private
ChmConsignmentDetailRepository
chmConsignmentDetailRepository
;
/**
* 转换运单明细
* @param mawbDetail
* @return
*/
public
ChmConsignmentDetail
convertToChmConsignmentDetail
(
MawbDetail
mawbDetail
){
public
ChmConsignmentDetail
convertToChmConsignmentDetail
(
MawbDetail
mawbDetail
,
ChmConsignment
chmConsignment
){
ChmConsignmentDetail
result
=
new
ChmConsignmentDetail
();
try
{
result
.
setChmConsignment
(
chmConsignment
);
//归类标志
//商品编号
...
...
@@ -35,7 +46,7 @@ public class ChmConsignmentDetailService {
//申报总价
result
.
setAmount
(
mawbDetail
.
getDeclTotal
());
//征免方式
DictionaryEntries
levyTypeDictionaryEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
NATURE_EXEMPTION
+
mawbDetail
.
getDutyMode
());
DictionaryEntries
levyTypeDictionaryEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
LEVY_TYPE
+
mawbDetail
.
getDutyMode
());
result
.
setLevyTypeDic
(
levyTypeDictionaryEntries
);
result
.
setLevyType
(
levyTypeDictionaryEntries
.
getChineseName
());
//货号
...
...
@@ -52,12 +63,12 @@ public class ChmConsignmentDetailService {
result
.
setKnockdownUnitDic
(
knockdownUnitEntries
);
result
.
setKnockdownUnit
(
knockdownUnitEntries
.
getChineseName
());
//商品规格、型号
result
.
setModel
(
mawbDetail
.
getG
M
odel
());
result
.
setModel
(
mawbDetail
.
getG
m
odel
());
//商品名称
result
.
setSkuName
(
mawbDetail
.
getG
N
ame
());
result
.
setSkuName
(
mawbDetail
.
getG
n
ame
());
//商品序号
//成交数量
result
.
setKnockdownNumber
(
BigDecimal
.
valueOf
(
mawbDetail
.
getG
Q
ty
().
doubleValue
()));
result
.
setKnockdownNumber
(
BigDecimal
.
valueOf
(
mawbDetail
.
getG
q
ty
().
doubleValue
()));
//原产国
DictionaryEntries
habitatDictonaryEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
COUNTRY
+
mawbDetail
.
getOriginCountry
());
result
.
setHabitatDic
(
habitatDictonaryEntries
);
...
...
@@ -106,4 +117,37 @@ public class ChmConsignmentDetailService {
return
result
;
}
public
List
<
ChmConsignmentDetail
>
findChmConsignmentDetailListByConsignmentCode
(
Long
consignmentId
){
List
<
ChmConsignmentDetail
>
result
=
new
ArrayList
<>();
try
{
result
=
chmConsignmentDetailRepository
.
findChmConsignmentDetailByConsignmentCode
(
consignmentId
);
}
catch
(
Exception
e
){
log
.
error
(
"findChmConsignmentDetailListByConsignmentCode() error:"
+
e
.
getMessage
());
}
return
result
;
}
public
void
saveDetailList
(
List
<
ChmConsignmentDetail
>
chmConsignmentDetailList
){
chmConsignmentDetailRepository
.
saveAll
(
chmConsignmentDetailList
);
}
public
void
saveChmConsignmentDetail
(
ChmConsignmentDetail
consignmentDetail
){
chmConsignmentDetailRepository
.
save
(
consignmentDetail
);
}
public
void
deleteChmConsignmentDetail
(
Long
id
){
chmConsignmentDetailRepository
.
deleteById
(
id
);
}
}
...
...
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentService.java
View file @
af9eae2
...
...
@@ -10,6 +10,7 @@ import com.erry.iclear.dateInterface.entity.DictionaryEntries;
import
com.erry.iclear.dateInterface.repository.ChmConsignmentRepository
;
import
com.erry.iclear.dateInterface.util.DateUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -176,6 +177,8 @@ public class ChmConsignmentService {
result
.
setConsStatus
(
transferWaybillStatusDictionaryEntries
.
getChineseName
());
//推送时间作为创建时间,可以用来校验数据的有序性,如果新的推送时间小于已有的创建时间,就不更新数据
result
.
setCreateTime
(
pushTime
);
result
.
setUpdateTime
(
pushTime
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
...
...
@@ -201,6 +204,28 @@ public class ChmConsignmentService {
/**
* 保存主单
* @param chmConsignment
* @return
*/
public
ChmConsignment
updateChmConsignment
(
ChmConsignment
chmConsignment
){
try
{
return
chmConsignmentRepository
.
save
(
chmConsignment
);
}
catch
(
Exception
e
){
log
.
error
(
"updateChmConsignment() error:"
+
e
.
getMessage
());
}
return
null
;
}
/**
* 根据运单号查找数据
* @param consignmentCode
* @return
...
...
@@ -227,7 +252,7 @@ public class ChmConsignmentService {
ChmConsignment
chmConsignment
=
this
.
convertToChmConsignment
(
mawb
,
pushTime
);
List
<
ChmConsignmentDetail
>
chmConsignmentDetailList
=
new
ArrayList
<>();
mawb
.
getMawbDetailList
().
forEach
(
detail
->{
chmConsignmentDetailList
.
add
(
chmConsignmentDetailService
.
convertToChmConsignmentDetail
(
detail
));
chmConsignmentDetailList
.
add
(
chmConsignmentDetailService
.
convertToChmConsignmentDetail
(
detail
,
chmConsignment
));
});
chmConsignment
.
setChmConsignmentDetailList
(
chmConsignmentDetailList
);
...
...
@@ -246,13 +271,33 @@ public class ChmConsignmentService {
//更新:
//如果有数据并且满足条件后才能更新数据
//条件1、状态为 待申报海关
//条件2、
推送时间小于
上次推送的时间
//条件2、
本次推送时间 >
上次推送的时间
}
else
if
(!
Objects
.
equals
(
chmConsignmentDB
,
null
)
&&
Objects
.
equals
(
chmConsignmentDB
.
getConsStatusDic
().
getCode
(),
"transferWaybillStatus_5"
)
&&
pushTime
.
getTime
()<
chmConsignmentDB
.
getCreateTime
().
getTime
()){
//TODO 提交时需要打开
&&
pushTime
.
getTime
()>
chmConsignmentDB
.
getUpdateTime
().
getTime
()
){
//TODO 更新数据
log
.
info
(
"更新主单"
+
mawb
.
getBillNo
());
for
(
ChmConsignmentDetail
newDetail:
chmConsignment
.
getChmConsignmentDetailList
()){
for
(
ChmConsignmentDetail
oldDetail:
chmConsignmentDB
.
getChmConsignmentDetailList
()){
if
(
Objects
.
equals
(
newDetail
.
getSkuCode
(),
oldDetail
.
getSkuCode
())){
//newDetail.setChmConsignment(chmConsignmentDB);
newDetail
.
setId
(
oldDetail
.
getId
());
}
}
}
chmConsignment
.
setId
(
chmConsignmentDB
.
getId
());
chmConsignment
.
setUpdateTime
(
pushTime
);
ChmConsignment
updateResult
=
this
.
saveChmConsignment
(
chmConsignment
);
if
(!
Objects
.
equals
(
updateResult
,
null
)){
log
.
info
(
"主单"
+
mawb
.
getBillNo
()+
" 保存成功,chmConsignmentId:"
+
updateResult
.
getId
());
}
else
{
log
.
info
(
"主单"
+
mawb
.
getBillNo
()+
" 保存失败"
);
}
}
}
catch
(
Exception
e
){
log
.
error
(
""
+
e
.
getMessage
());
...
...
src/main/java/com/erry/iclear/dateInterface/service/SimpleJpaRepositoryImpl.java
0 → 100644
View file @
af9eae2
package
com
.
erry
.
iclear
.
dateInterface
.
service
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanWrapper
;
import
org.springframework.beans.BeanWrapperImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.jpa.repository.support.JpaEntityInformation
;
import
org.springframework.data.jpa.repository.support.SimpleJpaRepository
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
javax.persistence.EntityManager
;
import
java.beans.PropertyDescriptor
;
import
java.util.HashSet
;
import
java.util.Optional
;
import
java.util.Set
;
/**
* @author Administrator
*/
public
class
SimpleJpaRepositoryImpl
<
T
,
ID
>
extends
SimpleJpaRepository
<
T
,
ID
>
{
private
final
JpaEntityInformation
<
T
,
?>
entityInformation
;
private
final
EntityManager
em
;
@Autowired
public
SimpleJpaRepositoryImpl
(
JpaEntityInformation
<
T
,
?>
entityInformation
,
EntityManager
entityManager
)
{
super
(
entityInformation
,
entityManager
);
this
.
entityInformation
=
entityInformation
;
this
.
em
=
entityManager
;
}
/**
* 通用save方法 :新增/选择性更新
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
<
S
extends
T
>
S
save
(
S
entity
)
{
//获取ID
ID
entityId
=
(
ID
)
entityInformation
.
getId
(
entity
);
Optional
<
T
>
optionalT
;
if
(
StringUtils
.
isEmpty
(
entityId
))
{
optionalT
=
Optional
.
empty
();
}
else
{
optionalT
=
findById
(
entityId
);
}
//获取空属性并处理成null
String
[]
nullProperties
=
getNullProperties
(
entity
);
//若根据ID查询结果为空
if
(!
optionalT
.
isPresent
())
{
//新增
em
.
persist
(
entity
);
return
entity
;
}
else
{
//1.获取最新对象
T
target
=
optionalT
.
get
();
//2.将非空属性覆盖到最新对象
BeanUtils
.
copyProperties
(
entity
,
target
,
nullProperties
);
//3.更新非空属性
em
.
merge
(
target
);
return
entity
;
}
}
/**
* 获取对象的空属性
*/
private
static
String
[]
getNullProperties
(
Object
src
)
{
//1.获取Bean
BeanWrapper
srcBean
=
new
BeanWrapperImpl
(
src
);
//2.获取Bean的属性描述
PropertyDescriptor
[]
pds
=
srcBean
.
getPropertyDescriptors
();
//3.获取Bean的空属性
Set
<
String
>
properties
=
new
HashSet
<>();
for
(
PropertyDescriptor
propertyDescriptor
:
pds
)
{
String
propertyName
=
propertyDescriptor
.
getName
();
Object
propertyValue
=
srcBean
.
getPropertyValue
(
propertyName
);
if
(
StringUtils
.
isEmpty
(
propertyValue
))
{
srcBean
.
setPropertyValue
(
propertyName
,
null
);
properties
.
add
(
propertyName
);
}
}
return
properties
.
toArray
(
new
String
[
0
]);
}
}
\ No newline at end of file
src/test/java/com/erry/iclear/dateInterface/ApiTest.java
View file @
af9eae2
...
...
@@ -13,7 +13,7 @@ public class ApiTest {
public
static
void
main
(
String
[]
args
)
{
//{"IEFlag":"E","type":"EX","agentCode":"1111980005","agentName":"联邦快递(中国)有限公司","billNo":"202105210784","contrNo":"NO.565733","customMaster":"0101","cutMode":"101","declTrnRel":"0","distinatePort":"ASM000","ediId":"001","entryId":"25512456","feeCurr":"USD","feeMark":"3","feeRate":100.58,"grossWet":500,"IEPort":"0101","inputerName":"","insurCurr":"MOP","insurMark":"3","insurRate":23.44,"manualNo":"备案号","netWt":80,"otherCurr":"USD","otherRate":10,"otherMark":"","ownerCode":"Z321654987","ownerName":"上海保险","packNo":1,"preEntryId":"","tradeCountry":"US","tradeMode":"110","tradeCode":"Z321654987","trafMode":"1","tradeName":"上海铢怡国际货物运输代理有限公司","transMode":"3","wrapType":"22","tradeCodeScc":"A74125896321456987","ownerCodeScc":"A74125896321456987","tradeAreaCode":"US","markNo":"N/M","entyPortCode":"310302","goodsPlace":"","declareName":"张安","overseasConsignorCode":"Z785421","overseasConsigneeCode":"Z785421","overseasConsigneeEname":"出口时必填收件人公司名(原)","mawbDetailList":[{"classMark":"","codeTS":"69125472","declPrice":111.123,"declTotal":788,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"
","firstQty":11,"GUnit":"007","GModel":"商品规格、型号","GName":"餐桌","GNo":"1","GQty":1,"originCountry":"USA","secondUnit":"007","secondQty":2,"tradeCurr":"USA","useTo":"","ciqCode":"","destinationCountry":"CHN","declGoodsEname":"","destCode":"","districtCode":"4408W"},{"classMark":"","codeTS":"69125472","declPrice":45.72,"declTotal":33,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"","firstQty":11,"GUnit":"007","GModel":"商品规格、型号","GName":"餐桌","GNo":"2","GQty":22,"originCountry":"USA","secondUnit":"007","secondQty":3,"tradeCurr":"USA","useTo":"","ciqCode":"","destinationCountry":"CH
N","declGoodsEname":"","destCode":"","districtCode":"4408W"}]}
//{"IEFlag":"E","type":"EX","agentCode":"1111980005","agentName":"联邦快递(中国)有限公司","billNo":"202105210784","contrNo":"NO.565733","customMaster":"0101","cutMode":"101","declTrnRel":"0","distinatePort":"ASM000","ediId":"001","entryId":"25512456","feeCurr":"USD","feeMark":"3","feeRate":100.58,"grossWet":500,"IEPort":"0101","inputerName":"","insurCurr":"MOP","insurMark":"3","insurRate":23.44,"manualNo":"备案号","netWt":80,"otherCurr":"USD","otherRate":10,"otherMark":"","ownerCode":"Z321654987","ownerName":"上海保险","packNo":1,"preEntryId":"","tradeCountry":"US","tradeMode":"110","tradeCode":"Z321654987","trafMode":"1","tradeName":"上海铢怡国际货物运输代理有限公司","transMode":"3","wrapType":"22","tradeCodeScc":"A74125896321456987","ownerCodeScc":"A74125896321456987","tradeAreaCode":"US","markNo":"N/M","entyPortCode":"310302","goodsPlace":"","declareName":"张安","overseasConsignorCode":"Z785421","overseasConsigneeCode":"Z785421","overseasConsigneeEname":"出口时必填收件人公司名(原)","mawbDetailList":[{"classMark":"","codeTS":"69125472","declPrice":111.123,"declTotal":788,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"
035","firstQty":11,"gunit":"007","gmodel":"商品规格、型号","gname":"餐桌","gno":"1","gqty":1.88,"originCountry":"US","secondUnit":"007","secondQty":2,"tradeCurr":"USD","useTo":"","ciqCode":"","destinationCountry":"CN","declGoodsEname":"","destCode":"","districtCode":"4408W"},{"classMark":"","codeTS":"69125472","declPrice":45.72,"declTotal":33,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"035","firstQty":11,"gunit":"007","gmodel":"商品规格、型号","gname":"餐桌","gno":"2","gqty":22.88,"originCountry":"US","secondUnit":"007","secondQty":3,"tradeCurr":"USD","useTo":"","ciqCode":"","destinationCountry":"C
N","declGoodsEname":"","destCode":"","districtCode":"4408W"}]}
MawbDetail
d1
=
new
MawbDetail
();
...
...
@@ -24,20 +24,20 @@ public class ApiTest {
d1
.
setDutyMode
(
"1"
);
d1
.
setExgNo
(
""
);
d1
.
setExgVersion
(
""
);
d1
.
setFirstUnit
(
""
);
d1
.
setFirstUnit
(
"
035
"
);
d1
.
setFirstQty
(
11
);
d1
.
setG
U
nit
(
"007"
);
d1
.
setG
M
odel
(
"商品规格、型号"
);
d1
.
setG
N
ame
(
"餐桌"
);
d1
.
setG
N
o
(
"1"
);
d1
.
setG
Qty
(
1
);
d1
.
setOriginCountry
(
"US
A
"
);
d1
.
setG
u
nit
(
"007"
);
d1
.
setG
m
odel
(
"商品规格、型号"
);
d1
.
setG
n
ame
(
"餐桌"
);
d1
.
setG
n
o
(
"1"
);
d1
.
setG
qty
(
BigDecimal
.
valueOf
(
1.88
)
);
d1
.
setOriginCountry
(
"US"
);
d1
.
setSecondUnit
(
"007"
);
d1
.
setSecondQty
(
2
);
d1
.
setTradeCurr
(
"US
A
"
);
d1
.
setTradeCurr
(
"US
D
"
);
d1
.
setUseTo
(
""
);
d1
.
setWorkUsd
(
null
);
d1
.
setDestinationCountry
(
"C
H
N"
);
d1
.
setDestinationCountry
(
"CN"
);
d1
.
setCiqCode
(
""
);
d1
.
setDeclGoodsEname
(
""
);
d1
.
setDestCode
(
""
);
...
...
@@ -52,20 +52,20 @@ public class ApiTest {
d2
.
setDutyMode
(
"1"
);
d2
.
setExgNo
(
""
);
d2
.
setExgVersion
(
""
);
d2
.
setFirstUnit
(
""
);
d2
.
setFirstUnit
(
"
035
"
);
d2
.
setFirstQty
(
11
);
d2
.
setG
U
nit
(
"007"
);
d2
.
setG
M
odel
(
"商品规格、型号"
);
d2
.
setG
N
ame
(
"餐桌"
);
d2
.
setG
N
o
(
"2"
);
d2
.
setG
Qty
(
22
);
d2
.
setOriginCountry
(
"US
A
"
);
d2
.
setG
u
nit
(
"007"
);
d2
.
setG
m
odel
(
"商品规格、型号"
);
d2
.
setG
n
ame
(
"餐桌"
);
d2
.
setG
n
o
(
"2"
);
d2
.
setG
qty
(
BigDecimal
.
valueOf
(
22.88
)
);
d2
.
setOriginCountry
(
"US"
);
d2
.
setSecondUnit
(
"007"
);
d2
.
setSecondQty
(
3
);
d2
.
setTradeCurr
(
"US
A
"
);
d2
.
setTradeCurr
(
"US
D
"
);
d2
.
setUseTo
(
""
);
d2
.
setWorkUsd
(
null
);
d2
.
setDestinationCountry
(
"C
H
N"
);
d2
.
setDestinationCountry
(
"CN"
);
d2
.
setCiqCode
(
""
);
d2
.
setDeclGoodsEname
(
""
);
d2
.
setDestCode
(
""
);
...
...
src/test/java/com/erry/iclear/dateInterface/ChmConsignmentServiceTest.java
View file @
af9eae2
...
...
@@ -41,11 +41,11 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests {
d1
.
setExgVersion
(
""
);
d1
.
setFirstUnit
(
"001"
);
d1
.
setFirstQty
(
11
);
d1
.
setG
U
nit
(
"007"
);
d1
.
setG
M
odel
(
"商品规格、型号"
);
d1
.
setG
N
ame
(
"餐桌"
);
d1
.
setG
N
o
(
"1"
);
d1
.
setG
Qty
(
1
);
d1
.
setG
u
nit
(
"007"
);
d1
.
setG
m
odel
(
"商品规格、型号"
);
d1
.
setG
n
ame
(
"餐桌"
);
d1
.
setG
n
o
(
"1"
);
d1
.
setG
qty
(
BigDecimal
.
valueOf
(
1.88
)
);
d1
.
setOriginCountry
(
"US"
);
d1
.
setSecondUnit
(
"007"
);
d1
.
setSecondQty
(
2
);
...
...
@@ -69,11 +69,11 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests {
d2
.
setExgVersion
(
""
);
d2
.
setFirstUnit
(
"001"
);
d2
.
setFirstQty
(
11
);
d2
.
setG
U
nit
(
"007"
);
d2
.
setG
M
odel
(
"商品规格、型号"
);
d2
.
setG
N
ame
(
"餐桌"
);
d2
.
setG
N
o
(
"2"
);
d2
.
setG
Qty
(
22
);
d2
.
setG
u
nit
(
"007"
);
d2
.
setG
m
odel
(
"商品规格、型号"
);
d2
.
setG
n
ame
(
"餐桌"
);
d2
.
setG
n
o
(
"2"
);
d2
.
setG
qty
(
BigDecimal
.
valueOf
(
22.88
)
);
d2
.
setOriginCountry
(
"US"
);
d2
.
setSecondUnit
(
"007"
);
d2
.
setSecondQty
(
3
);
...
...
src/test/java/com/erry/iclear/dateInterface/SHA256Test.java
View file @
af9eae2
...
...
@@ -11,10 +11,8 @@ public class SHA256Test {
public
static
void
main
(
String
[]
args
)
{
// long time =System.currentTimeMillis();
// System.out.println(time);
// String str = "CTM"+"iClearExport"+"b92131f03f19a348"+time;
//
//
// System.out.println(SHA256Util.getSHA256String(str));
String
str
=
"CTM"
+
"iClearExport"
+
"b92131f03f19a348"
+
1623920478192L
;
System
.
out
.
println
(
SHA256Util
.
getSHA256String
(
str
));
//
// 1623920478192
...
...
Please
register
or
login
to post a comment