Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
e1fab7ec
Commit
e1fab7ec
authored
Sep 04, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询物流
parent
8b9921a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
10 deletions
+28
-10
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
...om/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
+28
-10
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
View file @
e1fab7ec
...
...
@@ -2,14 +2,17 @@ package com.wwdz.ch.wx.impl.distribution;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.CommonEnum
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.entity.LogisticsInfo
;
import
com.wwdz.ch.core.entity.LogisticsRequestDto
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.CollectorWhiteListDao
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.dao.distribution.ExchangeOrderSnapshotDao
;
import
com.wwdz.ch.db.dao.distribution.IdentifyOrderDao
;
import
com.wwdz.ch.db.domain.CollectorWhiteList
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.domain.distribution.ExchangeOrderSnapshot
;
import
com.wwdz.ch.db.domain.distribution.IdentifyOrder
;
import
com.wwdz.ch.core.api.LogisticsApi
;
import
com.wwdz.ch.wx.service.distribution.LogisticsService
;
...
...
@@ -18,6 +21,9 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
@Service
public
class
LogisticsServiceImpl
implements
LogisticsService
{
...
...
@@ -36,6 +42,9 @@ public class LogisticsServiceImpl implements LogisticsService {
@Autowired
CollectorWhiteListDao
collectorWhiteListDao
;
@Autowired
ExchangeOrderSnapshotDao
exchangeOrderSnapshotDao
;
@Override
public
Result
findLogisticsInfo
(
String
orderId
)
{
try
{
...
...
@@ -71,26 +80,35 @@ public class LogisticsServiceImpl implements LogisticsService {
@Override
public
Result
findLogisticsInfo
(
LogisticsRequestDto
dto
)
{
try
{
DistributionOrder
distributionOrder
=
distributionOrderDao
.
findById
(
dto
.
getDistributionOrderId
());
int
type
=
dto
.
getType
();
String
logisticsCode
=
null
;
String
waybill
=
null
;
String
receiverInfo
=
null
;
LogisticsRequestDto
logisticsRequestDto
=
new
LogisticsRequestDto
();
if
(
type
==
CommonEnum
.
LogisticsTypeEnum
.
FROM
.
getCode
())
{
IdentifyOrder
identifyOrder
=
identifyOrderDao
.
findByDistributionOrderId
(
dto
.
getDistributionOrderId
());
logisticsCode
=
identifyOrder
.
getFromLogisticsCode
();
waybill
=
identifyOrder
.
getFromWaybill
(
);
DistributionOrder
distributionOrder
=
distributionOrderDao
.
findById
(
dto
.
getDistributionOrderId
());
//查询藏家是否具有直接发货给买家的权限
CollectorWhiteList
collectorWhiteList
=
collectorWhiteListDao
.
findById
(
distributionOrder
.
getSellerId
()
);
if
(
collectorWhiteList
!=
null
&&
1
==
collectorWhiteList
.
getDeliveryAuth
())
{
receiverInfo
=
distributionOrder
.
getReceiverName
()
+
","
+
distributionOrder
.
getReceiverPhone
()
+
","
+
distributionOrder
.
getReceiverAddress
();
//以物换物的订单,用户发货的快递信息在订单快照表中
if
(
DistributionEnum
.
DistributionTypeEnum
.
EXCHANGE
.
getCode
()
==
distributionOrder
.
getType
().
intValue
())
{
List
<
ExchangeOrderSnapshot
>
exchangeOrderSnapshotList
=
exchangeOrderSnapshotDao
.
findByOrderId
(
dto
.
getDistributionOrderId
()
);
if
(!
CollectionUtils
.
isEmpty
(
exchangeOrderSnapshotList
))
{
logisticsCode
=
exchangeOrderSnapshotList
.
get
(
0
).
getLogisticsCode
();
waybill
=
exchangeOrderSnapshotList
.
get
(
0
).
getWaybill
(
);
receiverInfo
=
CommConsts
.
SYSTEM_DEFAULT_ADDRESS
;
}
}
else
{
receiverInfo
=
CommConsts
.
SYSTEM_DEFAULT_ADDRESS
;
IdentifyOrder
identifyOrder
=
identifyOrderDao
.
findByDistributionOrderId
(
dto
.
getDistributionOrderId
());
logisticsCode
=
identifyOrder
.
getFromLogisticsCode
();
waybill
=
identifyOrder
.
getFromWaybill
();
//查询藏家是否具有直接发货给买家的权限
CollectorWhiteList
collectorWhiteList
=
collectorWhiteListDao
.
findById
(
distributionOrder
.
getSellerId
());
if
(
collectorWhiteList
!=
null
&&
1
==
collectorWhiteList
.
getDeliveryAuth
())
{
receiverInfo
=
distributionOrder
.
getReceiverName
()
+
","
+
distributionOrder
.
getReceiverPhone
()
+
","
+
distributionOrder
.
getReceiverAddress
();
}
else
{
receiverInfo
=
CommConsts
.
SYSTEM_DEFAULT_ADDRESS
;
}
}
logisticsRequestDto
.
setReceiverPhone
(
distributionOrder
.
getReceiverPhone
());
}
else
if
(
type
==
CommonEnum
.
LogisticsTypeEnum
.
DELIVERY
.
getCode
())
{
DistributionOrder
distributionOrder
=
distributionOrderDao
.
findById
(
dto
.
getDistributionOrderId
());
logisticsCode
=
distributionOrder
.
getLogisticsCode
();
waybill
=
distributionOrder
.
getWaybill
();
receiverInfo
=
distributionOrder
.
getReceiverName
()
+
","
+
distributionOrder
.
getReceiverPhone
()
+
","
+
distributionOrder
.
getReceiverAddress
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment