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
Jiaqi.xu
2021-07-08 18:07:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
09c527bb118ade17b0d8c1413771cc9244aea090
09c527bb
1 parent
19c6e6f7
代码提交
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
28 deletions
src/main/java/com/erry/iclear/dateInterface/api/request/Mawb.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/service/ChmConsignmentDetailService.java
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentService.java
src/main/java/com/erry/iclear/dateInterface/api/request/Mawb.java
View file @
09c527b
...
...
@@ -96,7 +96,6 @@ public class Mawb implements Serializable {
private
String
ediId
;
@ApiModelProperty
(
value
=
"海关编号"
,
name
=
"EntryId"
,
example
=
"001"
)
@NotBlank
(
message
=
"参数entryId不能为空"
)
@Column
(
name
=
"ENTRYID"
)
private
String
entryId
;
...
...
src/main/java/com/erry/iclear/dateInterface/common/Constant.java
View file @
09c527b
...
...
@@ -25,6 +25,28 @@ public class Constant {
*/
public
static
Map
<
String
,
DictionaryEntries
>
dictionaryEntriesCache
=
new
HashMap
<>();
//运单类型
public
static
final
String
CONS_TYPE
=
"consType"
;
/**
* A类型
*/
public
static
final
String
consType_A
=
"consType_A"
;
/**
* B类型
*/
public
static
final
String
consType_B
=
"consType_B"
;
/**
* C类型
*/
public
static
final
String
consType_C
=
"consType_C"
;
/**
* D类型
*/
public
static
final
String
consType_D
=
"consType_D"
;
/**
* tsn口岸
*/
public
static
final
String
PORT_TSN
=
"port_tsn"
;
/**
* 货源地
*/
...
...
src/main/java/com/erry/iclear/dateInterface/entity/ChmConsignment.java
View file @
09c527b
...
...
@@ -376,8 +376,10 @@ public class ChmConsignment implements Serializable {
/**
* 运单类型ID
*/
@Column
(
name
=
"CONS_TYPE_ID"
)
private
String
consTypeId
;
@JsonIgnore
@ManyToOne
(
targetEntity
=
DictionaryEntries
.
class
)
@JoinColumn
(
name
=
"CONS_TYPE_ID"
)
private
DictionaryEntries
consTypeId
;
/**
* 运单类型
...
...
@@ -385,6 +387,13 @@ public class ChmConsignment implements Serializable {
@Column
(
name
=
"CONS_TYPE"
)
private
String
consType
;
@JsonIgnore
@ManyToOne
(
targetEntity
=
DictionaryEntries
.
class
)
@JoinColumn
(
name
=
"PORT_ID"
)
private
DictionaryEntries
portId
;
@Column
(
name
=
"PORT_NAME"
)
private
String
portName
;
@OneToMany
(
mappedBy
=
"chmConsignment"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
ChmConsignmentDetail
>
chmConsignmentDetailList
;
...
...
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentDetailService.java
View file @
09c527b
...
...
@@ -54,12 +54,13 @@ public class ChmConsignmentDetailService {
//第一计量单位(法定单位)
DictionaryEntries
firstUnitDictionaryEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
TRANSACTION_UNIT
+
mawbDetail
.
getFirstUnit
());
result
.
setUnitLegalFirstId
(
firstUnitDictionaryEntries
);
result
.
set
KnockdownUni
t
(
firstUnitDictionaryEntries
.
getChineseName
());
result
.
set
UnitLegalFirs
t
(
firstUnitDictionaryEntries
.
getChineseName
());
//第一法定数量
result
.
setQtyLegalFirst
(
BigDecimal
.
valueOf
(
mawbDetail
.
getFirstQty
().
doubleValue
()));
//成交计量单位
DictionaryEntries
knockdownUnitEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
TRANSACTION_UNIT
+
mawbDetail
.
getFirstUnit
());
//2021年7月8日 成交单位有修改,原取值第一法定计量单位,先取值成交单位。xjq
DictionaryEntries
knockdownUnitEntries
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
TRANSACTION_UNIT
+
mawbDetail
.
getGunit
());
result
.
setKnockdownUnitDic
(
knockdownUnitEntries
);
result
.
setKnockdownUnit
(
knockdownUnitEntries
.
getChineseName
());
//商品规格、型号
...
...
src/main/java/com/erry/iclear/dateInterface/service/ChmConsignmentService.java
View file @
09c527b
...
...
@@ -154,9 +154,9 @@ public class ChmConsignmentService {
}
//运单类型
DictionaryEntries
consType
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
MSG_TYPE
_D
);
DictionaryEntries
consType
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
consType
_D
);
if
(
consType
!=
null
){
result
.
setConsTypeId
(
String
.
valueOf
(
consType
.
getId
())
);
result
.
setConsTypeId
(
consType
);
result
.
setConsType
(
consType
.
getChineseName
());
}
...
...
@@ -238,6 +238,13 @@ public class ChmConsignmentService {
result
.
setConsStatus
(
transferWaybillStatusDictionaryEntries
.
getChineseName
());
}
//添加TSN口岸
DictionaryEntries
portTSN
=
Constant
.
dictionaryEntriesCache
.
get
(
Constant
.
PORT_TSN
);
if
(!
Objects
.
equals
(
portTSN
,
null
)){
result
.
setPortId
(
portTSN
);
result
.
setPortName
(
portTSN
.
getChineseName
());
}
//西门子数据都为TSN口岸,可通过口岸查询查看
if
(
creator
.
equals
(
"IDE"
)){
result
.
setDeclaredPort
(
"TSN"
);
...
...
@@ -355,7 +362,6 @@ public class ChmConsignmentService {
//条件1、状态为 待申报海关
//条件2、本次推送时间 > 上次推送的时间
}
else
if
(!
Objects
.
equals
(
chmConsignmentDB
,
null
)
//TODO 确定是不是transferWaybillStatus_5
&&
Objects
.
equals
(
chmConsignmentDB
.
getConsStatusDic
().
getCode
(),
"transferWaybillStatus_5"
)
//TODO 提交时需要打开
&&
pushTime
.
getTime
()>
chmConsignmentDB
.
getUpdateTime
().
getTime
()
...
...
@@ -365,27 +371,14 @@ public class ChmConsignmentService {
//由于订单明细中,无法确定唯一一条数据,所以无法做到update,只能先删除在插入
// for(ChmConsignmentDetail newDetail:chmConsignment.getChmConsignmentDetailList()){
// for(ChmConsignmentDetail oldDetail: chmConsignmentDB.getChmConsignmentDetailList()){
// if(Objects.equals(newDetail.getSkuCode(),oldDetail.getSkuCode())){
// //newDetail.setChmConsignment(chmConsignmentDB);
// newDetail.setId(oldDetail.getId());
// }
// }
// }
//TODO 因为现在有了DetailId,所以可以根据DetailID进行更新,所以需要改为 update,去的掉detele的动作
List
<
Long
>
detailIdList
=
new
ArrayList
();
chmConsignmentDB
.
getChmConsignmentDetailList
().
forEach
(
detail
->{
detailIdList
.
add
(
detail
.
getId
());
});
if
(
detailIdList
.
size
()>
0
){
chmConsignmentDetailService
.
deleteChmConsignmentDetailBatch
(
detailIdList
);
chmConsignmentDB
.
setChmConsignmentDetailList
(
null
);
for
(
ChmConsignmentDetail
newDetail:
chmConsignment
.
getChmConsignmentDetailList
()){
for
(
ChmConsignmentDetail
oldDetail:
chmConsignmentDB
.
getChmConsignmentDetailList
()){
if
(
Objects
.
equals
(
newDetail
.
getDetailId
(),
oldDetail
.
getDetailId
())){
//newDetail.setChmConsignment(chmConsignmentDB);
newDetail
.
setId
(
oldDetail
.
getId
());
}
}
}
chmConsignment
.
setId
(
chmConsignmentDB
.
getId
());
chmConsignment
.
setCreateTime
(
chmConsignmentDB
.
getCreateTime
());
...
...
Please
register
or
login
to post a comment