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
zelong.shao
2023-11-07 10:58:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7beef4a88a5fb9be11904db2ddb9ab8508f8376b
7beef4a8
1 parent
5ca8d734
D类detal实体数据类型修改 第一法定数量、第二法定数量
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
27 deletions
src/main/java/com/erry/iclear/dateInterface/api/request/MawbDetail.java
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentDetailService.java
src/test/java/com/erry/iclear/dateInterface/ChmConsignmentServiceTest.java
src/test/java/com/erry/iclear/dateInterface/HttpClientTest.java
src/main/java/com/erry/iclear/dateInterface/api/request/MawbDetail.java
View file @
7beef4a
package
com
.
erry
.
iclear
.
dateInterface
.
api
.
request
;
import
com.erry.iclear.dateInterface.repository.MawbAdd
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
...
...
@@ -77,7 +75,7 @@ public class MawbDetail implements Serializable{
@ApiModelProperty
(
value
=
"第一法定数量"
)
@NotNull
(
message
=
"参数firstQty不能为空"
)
@Column
(
name
=
"FIRSTQTY"
)
private
Integer
firstQty
;
private
BigDecimal
firstQty
;
@ApiModelProperty
(
value
=
"成交计量单位"
)
//@NotBlank(message="参数gunit不能为空")
...
...
@@ -116,7 +114,7 @@ public class MawbDetail implements Serializable{
@ApiModelProperty
(
value
=
"第二法定数量"
)
@NotNull
(
message
=
"参数secondQty不能为空"
)
@Column
(
name
=
"SECONDQTY"
)
private
Integer
secondQty
;
private
BigDecimal
secondQty
;
@ApiModelProperty
(
value
=
"成交币制"
)
//@NotBlank(message="参数tradeCurr不能为空")
...
...
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentDetailService.java
View file @
7beef4a
...
...
@@ -14,8 +14,6 @@ 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
;
/**
...
...
@@ -63,7 +61,7 @@ public class ChmConsignmentDetailService {
result
.
setUnitLegalFirst
(
firstUnitDictionaryEntries
.
getChineseName
());
}
//第一法定数量
result
.
setQtyLegalFirst
(
BigDecimal
.
valueOf
(
mawbDetail
.
getFirstQty
().
doubleValue
()
));
result
.
setQtyLegalFirst
(
mawbDetail
.
getFirstQty
(
));
//成交计量单位
//2021年7月8日 成交单位有修改,原取值第一法定计量单位,先取值成交单位。xjq
DictionaryEntries
knockdownUnitEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
TRANSACTION_UNIT
+
mawbDetail
.
getGunit
());
...
...
@@ -98,7 +96,7 @@ public class ChmConsignmentDetailService {
result
.
setUnitLegalSecond
(
secondUnitDictionaryEntries
.
getChineseName
());
}
//第二法定数量
result
.
setQtyLegalSecond
(
BigDecimal
.
valueOf
(
mawbDetail
.
getSecondQty
().
doubleValue
()
));
result
.
setQtyLegalSecond
(
mawbDetail
.
getSecondQty
(
));
//成交币制
DictionaryEntries
currencyDictionaryEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
CURRENCY_SYSTEM
+
mawbDetail
.
getTradeCurr
());
if
(!
Objects
.
equals
(
currencyDictionaryEntries
,
null
)){
...
...
@@ -160,7 +158,7 @@ public class ChmConsignmentDetailService {
result
.
setUnitLegalFirst
(
firstUnitDictionaryEntries
.
getChineseName
());
}
//第一法定数量
result
.
setQtyLegalFirst
(
bigDecimalFormat
(
BigDecimal
.
valueOf
(
mawbDetail
.
getFirstQty
().
doubleValue
()
)));
result
.
setQtyLegalFirst
(
bigDecimalFormat
(
mawbDetail
.
getFirstQty
(
)));
//成交计量单位
//2021年7月8日 成交单位有修改,原取值第一法定计量单位,先取值成交单位。xjq
DictionaryEntries
knockdownUnitEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
TRANSACTION_UNIT
+
mawbDetail
.
getGunit
());
...
...
@@ -237,7 +235,7 @@ public class ChmConsignmentDetailService {
result
.
setFirstUnit
(
detail
.
getUnitLegalFirstId
().
getExt2
());
}
//第一法定数量
result
.
setFirstQty
(
NumberUtils
.
bigDecimalToIntger
(
bigDecimalFormatD
(
detail
.
getQtyLegalFirst
())));
result
.
setFirstQty
((
bigDecimalFormatD
(
detail
.
getQtyLegalFirst
())));
//成交计量单位 数字三字码
if
(!
Objects
.
equals
(
detail
.
getKnockdownUnitDic
(),
null
)){
result
.
setGunit
(
detail
.
getKnockdownUnitDic
().
getExt2
());
...
...
@@ -259,7 +257,7 @@ public class ChmConsignmentDetailService {
result
.
setSecondUnit
(
detail
.
getUnitLegalSecondId
().
getExt2
());
}
//第二法定数量
result
.
setSecondQty
(
NumberUtils
.
bigDecimalToIntger
(
bigDecimalFormatD
(
detail
.
getQtyLegalSecond
()
)));
result
.
setSecondQty
(
bigDecimalFormatD
(
detail
.
getQtyLegalSecond
(
)));
//成交币制 英文三字码
if
(!
Objects
.
equals
(
detail
.
getCurrencyDic
(),
null
)){
result
.
setTradeCurr
(
detail
.
getCurrencyDic
().
getExt2
());
...
...
src/test/java/com/erry/iclear/dateInterface/ChmConsignmentServiceTest.java
View file @
7beef4a
package
com
.
erry
.
iclear
.
dateInterface
;
import
com.erry.iclear.dateInterface.api.CustomsDataInterface
;
import
com.erry.iclear.dateInterface.api.request.*
;
import
com.erry.iclear.dateInterface.api.response.ResultRS
;
import
com.erry.iclear.dateInterface.service.FedexService
;
import
com.erry.iclear.dateInterface.api.request.FedexDetail
;
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.service.ChmConsignmentService
;
import
com.erry.iclear.dateInterface.service.FedexService
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
public
class
ChmConsignmentServiceTest
extends
IClearApiApplicationTests
{
...
...
@@ -101,7 +102,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests {
d1
.
setExgNo
(
""
);
d1
.
setExgVersion
(
""
);
d1
.
setFirstUnit
(
"001"
);
d1
.
setFirstQty
(
11
);
//
d1.setFirstQty(11);
d1
.
setGunit
(
"007"
);
d1
.
setGmodel
(
"商品规格、型号"
);
d1
.
setGname
(
"餐桌"
);
...
...
@@ -109,7 +110,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests {
d1
.
setGqty
(
BigDecimal
.
valueOf
(
1.88
));
d1
.
setOriginCountry
(
"US"
);
d1
.
setSecondUnit
(
"007"
);
d1
.
setSecondQty
(
2
);
//
d1.setSecondQty(2);
d1
.
setTradeCurr
(
"USD"
);
d1
.
setUseTo
(
""
);
d1
.
setWorkUsd
(
null
);
...
...
@@ -129,7 +130,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests {
d2
.
setExgNo
(
""
);
d2
.
setExgVersion
(
""
);
d2
.
setFirstUnit
(
"001"
);
d2
.
setFirstQty
(
11
);
//
d2.setFirstQty(11);
d2
.
setGunit
(
"007"
);
d2
.
setGmodel
(
"商品规格、型号"
);
d2
.
setGname
(
"餐桌"
);
...
...
@@ -137,7 +138,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests {
d2
.
setGqty
(
BigDecimal
.
valueOf
(
22.88
));
d2
.
setOriginCountry
(
"US"
);
d2
.
setSecondUnit
(
"007"
);
d2
.
setSecondQty
(
3
);
//
d2.setSecondQty(3);
d2
.
setTradeCurr
(
"USD"
);
d2
.
setUseTo
(
""
);
d2
.
setWorkUsd
(
null
);
...
...
src/test/java/com/erry/iclear/dateInterface/HttpClientTest.java
View file @
7beef4a
...
...
@@ -4,19 +4,18 @@ import com.arronlong.httpclientutil.HttpClientUtil;
import
com.arronlong.httpclientutil.builder.HCB
;
import
com.arronlong.httpclientutil.common.HttpConfig
;
import
com.arronlong.httpclientutil.common.HttpHeader
;
import
com.arronlong.httpclientutil.common.HttpResult
;
import
com.arronlong.httpclientutil.common.SSLs
;
import
com.arronlong.httpclientutil.exception.HttpProcessException
;
import
com.erry.iclear.dateInterface.api.request.Mawb
;
import
com.erry.iclear.dateInterface.api.request.MawbDetail
;
import
com.erry.iclear.dateInterface.util.SHA256Util
;
import
com.google.gson.Gson
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.Header
;
import
java.io.FileNotFoundException
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
public
class
HttpClientTest
{
public
static
void
main
(
String
[]
args
)
throws
HttpProcessException
,
FileNotFoundException
{
...
...
@@ -76,7 +75,7 @@ public class HttpClientTest {
d1
.
setExgNo
(
""
);
d1
.
setExgVersion
(
""
);
d1
.
setFirstUnit
(
"035"
);
d1
.
setFirstQty
(
11
);
//
d1.setFirstQty(11);
d1
.
setGunit
(
"007"
);
d1
.
setGmodel
(
"商品规格、型号"
);
d1
.
setGname
(
"餐桌"
);
...
...
@@ -84,7 +83,7 @@ public class HttpClientTest {
d1
.
setGqty
(
BigDecimal
.
valueOf
(
1.88
));
d1
.
setOriginCountry
(
"US"
);
d1
.
setSecondUnit
(
"007"
);
d1
.
setSecondQty
(
2
);
//
d1.setSecondQty(2);
d1
.
setTradeCurr
(
"USD"
);
d1
.
setUseTo
(
""
);
d1
.
setWorkUsd
(
null
);
...
...
@@ -105,7 +104,7 @@ public class HttpClientTest {
d2
.
setExgNo
(
""
);
d2
.
setExgVersion
(
""
);
d2
.
setFirstUnit
(
"035"
);
d2
.
setFirstQty
(
11
);
//
d2.setFirstQty(11);
d2
.
setGunit
(
"007"
);
d2
.
setGmodel
(
"商品规格、型号"
);
d2
.
setGname
(
"餐桌"
);
...
...
@@ -113,7 +112,7 @@ public class HttpClientTest {
d2
.
setGqty
(
BigDecimal
.
valueOf
(
22.88
));
d2
.
setOriginCountry
(
"US"
);
d2
.
setSecondUnit
(
"007"
);
d2
.
setSecondQty
(
3
);
//
d2.setSecondQty(3);
d2
.
setTradeCurr
(
"USD"
);
d2
.
setUseTo
(
""
);
d2
.
setWorkUsd
(
null
);
...
...
Please
register
or
login
to post a comment