Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MultipleSourceSecurity
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周宗顺
MultipleSourceSecurity
Commits
f7ee6da8
Commit
f7ee6da8
authored
Nov 07, 2025
by
Allen Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
1044b603
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
19 deletions
+41
-19
PddLocalController.java
.../java/org/ta/pddserver/controller/PddLocalController.java
+11
-2
PddOpenController.java
...n/java/org/ta/pddserver/controller/PddOpenController.java
+1
-1
PddGDUtil.java
...erver/src/main/java/org/ta/pddserver/utils/PddGDUtil.java
+0
-1
PddHttpTool.java
...ver/src/main/java/org/ta/pddserver/utils/PddHttpTool.java
+16
-2
application.yaml
PddServer/src/main/resources/application.yaml
+6
-6
CommonTest.java
PddServer/src/test/java/org/ta/pddserver/CommonTest.java
+7
-7
No files found.
PddServer/src/main/java/org/ta/pddserver/controller/PddLocalController.java
View file @
f7ee6da8
...
@@ -51,8 +51,15 @@ public class PddLocalController {
...
@@ -51,8 +51,15 @@ public class PddLocalController {
private
static
final
String
PROVIDER_CODE
=
"HAIJI_KR"
;
private
static
final
String
PROVIDER_CODE
=
"HAIJI_KR"
;
private
static
final
String
WAREHOUSE_CODE
=
"HJJY001"
;
private
static
final
String
WAREHOUSE_CODE
=
"HJJY001"
;
private
static
final
String
CLIENT_ID
=
"d0217707e1194c46b57e696ac7619a06"
;
// 测试
private
static
final
String
CLIENT_SECRET
=
"a5aba84483d8387030899f01276b06a194942470"
;
// private static final String CLIENT_ID = "d0217707e1194c46b57e696ac7619a06";
// private static final String CLIENT_SECRET = "a5aba84483d8387030899f01276b06a194942470";
// 正式
private
static
final
String
CLIENT_ID
=
"8f5f3f9c92e847b2894fc9c0afce3d61"
;
private
static
final
String
CLIENT_SECRET
=
"281d79ad5117d20a51efb9e7b0d5f7ee336399b0"
;
@Resource
@Resource
private
CollectReceiverDetailImpl
collectReceiverDetailImpl
;
private
CollectReceiverDetailImpl
collectReceiverDetailImpl
;
@Resource
@Resource
...
@@ -268,6 +275,8 @@ public class PddLocalController {
...
@@ -268,6 +275,8 @@ public class PddLocalController {
if
(
mailNoResponse
.
getStatus
()
!=
StatusEnum
.
INBOUND
.
getCode
()){
if
(
mailNoResponse
.
getStatus
()
!=
StatusEnum
.
INBOUND
.
getCode
()){
//重复入库
//重复入库
notifyRequest
.
setPackageQuantity
(
num
);
// 已入库数量
notifyRequest
.
setPackageQuantity
(
num
);
// 已入库数量
mailNoResponse
.
setEnterTime
(
timeTool
.
getNowDate
());
mailNoResponse
.
setStatus
(
StatusEnum
.
INBOUND
.
getCode
());
}
else
{
}
else
{
...
...
PddServer/src/main/java/org/ta/pddserver/controller/PddOpenController.java
View file @
f7ee6da8
...
@@ -102,7 +102,7 @@ public class PddOpenController {
...
@@ -102,7 +102,7 @@ public class PddOpenController {
log
.
info
(
"Request:\n{}"
,
body
);
log
.
info
(
"Request:\n{}"
,
body
);
try
{
try
{
if
(!
PddSignTool
.
verifySignFromBody
(
body
,
"
a5aba84483d8387030899f01276b06a19494247
0"
,
pdd_sign
))
{
if
(!
PddSignTool
.
verifySignFromBody
(
body
,
"
281d79ad5117d20a51efb9e7b0d5f7ee336399b
0"
,
pdd_sign
))
{
log
.
error
(
"验签失败"
);
log
.
error
(
"验签失败"
);
}
}
switch
(
requestParam
.
getType
())
{
switch
(
requestParam
.
getType
())
{
...
...
PddServer/src/main/java/org/ta/pddserver/utils/PddGDUtil.java
View file @
f7ee6da8
...
@@ -53,7 +53,6 @@ public class PddGDUtil {
...
@@ -53,7 +53,6 @@ public class PddGDUtil {
request
.
setTimestamp
(
time
);
request
.
setTimestamp
(
time
);
request
.
setSign
(
PddSignTool
.
generateSign
(
request
,
CLIENT_SECRET
));
request
.
setSign
(
PddSignTool
.
generateSign
(
request
,
CLIENT_SECRET
));
String
resp
=
PddHttpTool
.
sendJsonPostGD
(
request
);
String
resp
=
PddHttpTool
.
sendJsonPostGD
(
request
);
log
.
info
(
"resp = {}"
,
resp
);
return
JSON
.
parseObject
(
resp
);
return
JSON
.
parseObject
(
resp
);
}
}
}
}
PddServer/src/main/java/org/ta/pddserver/utils/PddHttpTool.java
View file @
f7ee6da8
...
@@ -43,16 +43,30 @@ public class PddHttpTool {
...
@@ -43,16 +43,30 @@ public class PddHttpTool {
public
static
String
sendJsonPost
(
Object
requestObj
)
{
public
static
String
sendJsonPost
(
Object
requestObj
)
{
log
.
info
(
"REQ:{}"
,
JSONObject
.
toJSONString
(
requestObj
));
log
.
info
(
"REQ:{}"
,
JSONObject
.
toJSONString
(
requestObj
));
// 自动序列化 requestObj 为 JSON,并设置 Content-Type: application/json
// 自动序列化 requestObj 为 JSON,并设置 Content-Type: application/json
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
set
(
"X-Canary-Staging"
,
"staging"
);
headers
.
add
(
"Content-Type"
,
"application/json;charset=UTF-8"
);
HttpEntity
<
String
>
requestEntity
=
new
HttpEntity
<>(
JSONObject
.
toJSONString
(
requestObj
),
headers
);
// 2. 封装请求实体(参数 + 头信息)
RestTemplate
restTemplate
=
new
RestTemplate
();
RestTemplate
restTemplate
=
new
RestTemplate
();
ResponseEntity
<
String
>
resp
=
restTemplate
.
postForEntity
(
URL
,
requestObj
,
String
.
class
);
ResponseEntity
<
String
>
resp
=
restTemplate
.
postForEntity
(
URL
,
requestEntity
,
String
.
class
);
log
.
info
(
"RESP:{}"
,
resp
.
getBody
());
return
resp
.
getBody
();
return
resp
.
getBody
();
}
}
public
static
String
sendJsonPostGD
(
Object
requestObj
)
{
public
static
String
sendJsonPostGD
(
Object
requestObj
)
{
log
.
info
(
"REQ:{}"
,
JSONObject
.
toJSONString
(
requestObj
));
log
.
info
(
"REQ:{}"
,
JSONObject
.
toJSONString
(
requestObj
));
// 自动序列化 requestObj 为 JSON,并设置 Content-Type: application/json
// 自动序列化 requestObj 为 JSON,并设置 Content-Type: application/json
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
set
(
"X-Canary-Staging"
,
"staging"
);
headers
.
add
(
"Content-Type"
,
"application/json;charset=UTF-8"
);
HttpEntity
<
String
>
requestEntity
=
new
HttpEntity
<>(
JSONObject
.
toJSONString
(
requestObj
),
headers
);
// 2. 封装请求实体(参数 + 头信息)
RestTemplate
restTemplate
=
new
RestTemplate
();
RestTemplate
restTemplate
=
new
RestTemplate
();
ResponseEntity
<
String
>
resp
=
restTemplate
.
postForEntity
(
URL_GD
,
requestObj
,
String
.
class
);
ResponseEntity
<
String
>
resp
=
restTemplate
.
postForEntity
(
URL_GD
,
requestEntity
,
String
.
class
);
log
.
info
(
"RESP:{}"
,
resp
.
getBody
());
return
resp
.
getBody
();
return
resp
.
getBody
();
}
}
}
}
PddServer/src/main/resources/application.yaml
View file @
f7ee6da8
spring
:
spring
:
datasource
:
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://192.168.2.222:3306/pdd_api?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT
#
url: jdbc:mysql://192.168.2.222:3306/pdd_api?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT
username
:
root
#
username: root
password
:
root
#
password: root
# url: jdbc:mysql://lyhj-mysql.mysql.rds.aliyuncs.com:3306/pdd_test
?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT
url
:
jdbc:mysql://lyhj-mysql.mysql.rds.aliyuncs.com:3306/pdd_prod
?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT
#
username: pdd
username
:
pdd
#
password: pdd123
password
:
pdd123
hikari
:
hikari
:
minimum-idle
:
5
# 最小空闲连接数
minimum-idle
:
5
# 最小空闲连接数
maximum-pool-size
:
10
# 最大活跃连接数
maximum-pool-size
:
10
# 最大活跃连接数
...
...
PddServer/src/test/java/org/ta/pddserver/CommonTest.java
View file @
f7ee6da8
...
@@ -22,7 +22,7 @@ public class CommonTest {
...
@@ -22,7 +22,7 @@ public class CommonTest {
private
static
final
String
CLIENT_ID
=
"8f5f3f9c92e847b2894fc9c0afce3d61"
;
private
static
final
String
CLIENT_ID
=
"8f5f3f9c92e847b2894fc9c0afce3d61"
;
private
static
final
String
CLIENT_SECRET
=
"281d79ad5117d20a51efb9e7b0d5f7ee336399b0"
;
private
static
final
String
CLIENT_SECRET
=
"281d79ad5117d20a51efb9e7b0d5f7ee336399b0"
;
private
String
firstLogisticsOrderCode
=
"PC25110
416466837504037527
"
;
private
String
firstLogisticsOrderCode
=
"PC25110
715653142530023271
"
;
private
static
String
getNowString
()
{
private
static
String
getNowString
()
{
Date
date
=
new
Date
();
Date
date
=
new
Date
();
...
@@ -92,8 +92,8 @@ public class CommonTest {
...
@@ -92,8 +92,8 @@ public class CommonTest {
*/
*/
@Test
@Test
public
void
receive
()
{
public
void
receive
()
{
String
mailNo
=
"
773846466954492
"
;
String
mailNo
=
"
SF3270717746148
"
;
String
expressCode
=
"S
TO
"
;
String
expressCode
=
"S
F
"
;
String
action
=
"warehouse_sign"
;
String
action
=
"warehouse_sign"
;
PddServiceConsoFirstBizActionNotifyRequest
notifyRequest
=
new
PddServiceConsoFirstBizActionNotifyRequest
();
PddServiceConsoFirstBizActionNotifyRequest
notifyRequest
=
new
PddServiceConsoFirstBizActionNotifyRequest
();
notifyRequest
.
setProviderCode
(
PROVIDER_CODE
);
notifyRequest
.
setProviderCode
(
PROVIDER_CODE
);
...
@@ -198,8 +198,8 @@ public class CommonTest {
...
@@ -198,8 +198,8 @@ public class CommonTest {
@Test
@Test
public
void
inBound
()
{
public
void
inBound
()
{
String
mailNo
=
"
773846466954492
"
;
String
mailNo
=
"
SF3270717746148
"
;
String
expressCode
=
"S
TO
"
;
String
expressCode
=
"S
F
"
;
PddServiceConsoInboundRequest
notifyRequest
=
new
PddServiceConsoInboundRequest
();
PddServiceConsoInboundRequest
notifyRequest
=
new
PddServiceConsoInboundRequest
();
...
@@ -220,8 +220,8 @@ public class CommonTest {
...
@@ -220,8 +220,8 @@ public class CommonTest {
notifyRequest
.
getPackageInfo
().
setLength
(
30L
);
notifyRequest
.
getPackageInfo
().
setLength
(
30L
);
notifyRequest
.
getPackageInfo
().
setWidth
(
30L
);
notifyRequest
.
getPackageInfo
().
setWidth
(
30L
);
notifyRequest
.
getPackageInfo
().
setHeight
(
30L
);
notifyRequest
.
getPackageInfo
().
setHeight
(
30L
);
notifyRequest
.
getPackageInfo
().
setWeight
(
6
00L
);
notifyRequest
.
getPackageInfo
().
setWeight
(
10
00L
);
notifyRequest
.
getPackageInfo
().
setActualWeight
(
6
00L
);
notifyRequest
.
getPackageInfo
().
setActualWeight
(
10
00L
);
notifyRequest
.
getPackageInfo
().
setGoodsType
(
"NORMAL"
);
notifyRequest
.
getPackageInfo
().
setGoodsType
(
"NORMAL"
);
notifyRequest
.
setResult
(
new
PddServiceConsoInboundRequest
.
Result
());
notifyRequest
.
setResult
(
new
PddServiceConsoInboundRequest
.
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