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
adb4585a
Commit
adb4585a
authored
Aug 15, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
顺丰查询物流轨迹需要带用户手机后4位号码
parent
b9b5efe4
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
17 deletions
+35
-17
ch-admin-api/src/main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
.../main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
+1
-0
ch-core/src/main/java/com/wwdz/ch/core/api/LogisticsApi.java
ch-core/src/main/java/com/wwdz/ch/core/api/LogisticsApi.java
+20
-11
ch-core/src/main/java/com/wwdz/ch/core/entity/LogisticsRequestDto.java
...ain/java/com/wwdz/ch/core/entity/LogisticsRequestDto.java
+2
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
...com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
...om/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
+6
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SendMsgFromExcelJob.java
...src/main/java/com/wwdz/ch/wx/job/SendMsgFromExcelJob.java
+2
-2
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
...pi/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
+3
-2
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
View file @
adb4585a
...
...
@@ -97,6 +97,7 @@ public class RefreshLogisticsJob {
LogisticsRequestDto
logisticsRequestDto
=
new
LogisticsRequestDto
();
logisticsRequestDto
.
setLogisticsCode
(
distributionOrder
.
getLogisticsCode
());
logisticsRequestDto
.
setWaybill
(
distributionOrder
.
getWaybill
());
logisticsRequestDto
.
setReceiverPhone
(
distributionOrder
.
getReceiverPhone
());
Result
result
=
logisticsApi
.
findTrails
(
logisticsRequestDto
);
if
(!
result
.
getSuccess
())
{
logger
.
error
(
"订单号:{} 查询物流轨迹失败"
,
orderId
);
...
...
ch-core/src/main/java/com/wwdz/ch/core/api/LogisticsApi.java
View file @
adb4585a
package
com.wwdz.ch.core.api
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.CommonEnum
;
import
com.wwdz.ch.core.consts.LogisticsEnum
;
import
com.wwdz.ch.core.entity.LogisticsInfo
;
...
...
@@ -7,9 +8,13 @@ import com.wwdz.ch.core.entity.LogisticsRequestDto;
import
com.wwdz.ch.core.entity.TrailInfo
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.Base64
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.xxdxxs.utils.JsonUtils
;
import
com.xxdxxs.utils.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.io.*
;
...
...
@@ -30,6 +35,9 @@ public class LogisticsApi {
@Value
(
"${dts.wx.apikey}"
)
private
String
APIKEY
;
@Autowired
DistributionOrderDao
distributionOrderDao
;
private
final
static
String
GET_TRAIL_URL
=
"https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx"
;
...
...
@@ -38,21 +46,22 @@ public class LogisticsApi {
*/
public
Result
findTrails
(
LogisticsRequestDto
dto
){
try
{
String
RequestData
=
"{"
+
"'ShipperCode': '"
+
dto
.
getLogisticsCode
()
+
"',"
+
"'LogisticCode': '"
+
dto
.
getWaybill
()
+
"',"
+
"}"
;
Map
<
String
,
String
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"ShipperCode"
,
dto
.
getLogisticsCode
());
paramMap
.
put
(
"LogisticCode"
,
dto
.
getWaybill
());
if
(
LogisticsEnum
.
SF
.
getCode
().
equals
(
dto
.
getLogisticsCode
()))
{
if
(
StringUtils
.
hasLength
(
dto
.
getReceiverPhone
()))
{
paramMap
.
put
(
"CustomerName"
,
dto
.
getReceiverPhone
().
substring
(
dto
.
getReceiverPhone
().
length
()
-
4
));
}
}
String
requestData
=
JsonUtils
.
from
(
paramMap
);
// 组装系统级参数
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"RequestData"
,
urlEncoder
(
R
equestData
,
"UTF-8"
));
params
.
put
(
"RequestData"
,
urlEncoder
(
r
equestData
,
"UTF-8"
));
params
.
put
(
"EBusinessID"
,
KUAIDINIAO_ID
);
params
.
put
(
"RequestType"
,
"8001"
);
String
dataSign
=
encrypt
(
R
equestData
,
APIKEY
,
"UTF-8"
);
String
dataSign
=
encrypt
(
r
equestData
,
APIKEY
,
"UTF-8"
);
params
.
put
(
"DataSign"
,
urlEncoder
(
dataSign
,
"UTF-8"
));
params
.
put
(
"DataType"
,
"2"
);
String
result
=
sendPost
(
GET_TRAIL_URL
,
params
);
...
...
ch-core/src/main/java/com/wwdz/ch/core/entity/LogisticsRequestDto.java
View file @
adb4585a
...
...
@@ -12,6 +12,8 @@ public class LogisticsRequestDto implements Entity {
private
String
waybill
;
private
String
receiverPhone
;
/**
* 物流单号类型
*/
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
View file @
adb4585a
...
...
@@ -132,7 +132,7 @@
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if
test=
"example.distinct"
>
distinct
</if>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
View file @
adb4585a
...
...
@@ -45,6 +45,7 @@ public class LogisticsServiceImpl implements LogisticsService {
LogisticsRequestDto
logisticsRequestDto
=
new
LogisticsRequestDto
();
logisticsRequestDto
.
setLogisticsCode
(
distributionOrder
.
getLogisticsCode
());
logisticsRequestDto
.
setWaybill
(
distributionOrder
.
getWaybill
());
logisticsRequestDto
.
setReceiverPhone
(
distributionOrder
.
getReceiverPhone
());
Result
result
=
logisticsApi
.
findTrails
(
logisticsRequestDto
);
if
(
result
.
getSuccess
())
{
LogisticsInfo
logisticsInfo
=
(
LogisticsInfo
)
result
.
getData
();
...
...
@@ -74,6 +75,7 @@ public class LogisticsServiceImpl implements LogisticsService {
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
();
...
...
@@ -86,20 +88,23 @@ public class LogisticsServiceImpl implements LogisticsService {
}
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
();
logisticsRequestDto
.
setReceiverPhone
(
distributionOrder
.
getReceiverPhone
());
}
else
if
(
type
==
CommonEnum
.
LogisticsTypeEnum
.
SEND_BACK
.
getCode
())
{
IdentifyOrder
identifyOrder
=
identifyOrderDao
.
findByDistributionOrderId
(
dto
.
getDistributionOrderId
());
logisticsCode
=
identifyOrder
.
getOutLogisticsCode
();
waybill
=
identifyOrder
.
getOutWaybill
();
receiverInfo
=
identifyOrder
.
getReturnName
()
+
","
+
identifyOrder
.
getReturnPhone
()
+
","
+
identifyOrder
.
getReturnAddress
();
logisticsRequestDto
.
setReceiverPhone
(
identifyOrder
.
getReturnPhone
());
}
LogisticsRequestDto
logisticsRequestDto
=
new
LogisticsRequestDto
();
logisticsRequestDto
.
setLogisticsCode
(
logisticsCode
);
logisticsRequestDto
.
setWaybill
(
waybill
);
Result
result
=
logisticsApi
.
findTrails
(
logisticsRequestDto
);
if
(
result
.
getSuccess
())
{
LogisticsInfo
logisticsInfo
=
(
LogisticsInfo
)
result
.
getData
();
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SendMsgFromExcelJob.java
View file @
adb4585a
...
...
@@ -48,7 +48,7 @@ public class SendMsgFromExcelJob {
private
String
env
;
// 每年8月14日晚上19点执行一次
@Scheduled
(
cron
=
"0 20 19 14 8 ?"
)
//
@Scheduled(cron = "0 20 19 14 8 ?")
public
void
executeTask
()
{
if
(
"dev"
.
equals
(
env
))
{
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行给指定类目用户发送通知任务<<<<<<<<<<<<<<<<<<<<<"
);
...
...
@@ -93,7 +93,7 @@ public class SendMsgFromExcelJob {
msg
=
"如是画苑·中美协画家专场开始啦,请前往"
+
url
+
"查看"
;
}
if
(
StringUtils
.
hasLength
(
msg
))
{
aliSmsSender
.
sendSms
(
phone
,
msg
);
//
aliSmsSender.sendSms(phone, msg);
logger
.
info
(
"手机号: {}, msg: {}, 发送短信成功"
,
phone
,
msg
);
}
}
...
...
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
View file @
adb4585a
...
...
@@ -29,8 +29,9 @@ public class LogisticsApiTest {
@Test
public
void
findTrails
()
{
LogisticsRequestDto
dto
=
new
LogisticsRequestDto
();
dto
.
setLogisticsCode
(
"EMS"
);
dto
.
setWaybill
(
"9858779957787"
);
dto
.
setLogisticsCode
(
"SF"
);
dto
.
setWaybill
(
"SF1440039031603"
);
dto
.
setReceiverPhone
(
"13817817481"
);
Result
result
=
logisticsApi
.
findTrails
(
dto
);
logger
.
info
(
"物流轨迹: {}"
+
result
);
}
...
...
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