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
1152dda6
Commit
1152dda6
authored
Nov 06, 2025
by
Allen Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
f14e0b27
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
PddGDUtil.java
...erver/src/main/java/org/ta/pddserver/utils/PddGDUtil.java
+3
-1
PddHttpTool.java
...ver/src/main/java/org/ta/pddserver/utils/PddHttpTool.java
+5
-0
PddSignTool.java
...ver/src/main/java/org/ta/pddserver/utils/PddSignTool.java
+1
-1
GDOperator.java
PddServer/src/main/java/org/ta/pddserver/xxl/GDOperator.java
+3
-8
No files found.
PddServer/src/main/java/org/ta/pddserver/utils/PddGDUtil.java
View file @
1152dda6
...
@@ -25,8 +25,10 @@ public class PddGDUtil {
...
@@ -25,8 +25,10 @@ public class PddGDUtil {
while
(
page
*
page_size
<=
total_count
)
{
while
(
page
*
page_size
<=
total_count
)
{
page
++;
page
++;
try
{
try
{
JSONObject
jsonObject
=
getTicketsByPage
(
1
,
end
);
JSONObject
respObject
=
getTicketsByPage
(
1
,
end
);
JSONObject
jsonObject
=
respObject
.
getJSONObject
(
"logistics_ticket_get_response"
);
total_count
=
jsonObject
.
getInteger
(
"total_count"
);
total_count
=
jsonObject
.
getInteger
(
"total_count"
);
log
.
info
(
"本次数量:{}"
,
total_count
);
List
<
GDTicketRepsonse
>
tempList
=
jsonObject
.
getJSONArray
(
"logistics_ticket_list"
).
toJavaList
(
GDTicketRepsonse
.
class
);
List
<
GDTicketRepsonse
>
tempList
=
jsonObject
.
getJSONArray
(
"logistics_ticket_list"
).
toJavaList
(
GDTicketRepsonse
.
class
);
if
(
tempList
!=
null
&&
!
tempList
.
isEmpty
())
{
if
(
tempList
!=
null
&&
!
tempList
.
isEmpty
())
{
list
.
addAll
(
tempList
);
list
.
addAll
(
tempList
);
...
...
PddServer/src/main/java/org/ta/pddserver/utils/PddHttpTool.java
View file @
1152dda6
package
org
.
ta
.
pddserver
.
utils
;
package
org
.
ta
.
pddserver
.
utils
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
...
@@ -13,6 +15,7 @@ import java.util.HashMap;
...
@@ -13,6 +15,7 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
@Slf4j
public
class
PddHttpTool
{
public
class
PddHttpTool
{
// private static final String URL = "https://opengw-api.hutaojie.com/ark/router";
// private static final String URL = "https://opengw-api.hutaojie.com/ark/router";
// private static final String URL_GD = "https://opengw-api.hutaojie.com/api/router";
// private static final String URL_GD = "https://opengw-api.hutaojie.com/api/router";
...
@@ -38,6 +41,7 @@ public class PddHttpTool {
...
@@ -38,6 +41,7 @@ public class PddHttpTool {
}
}
public
static
String
sendJsonPost
(
Object
requestObj
)
{
public
static
String
sendJsonPost
(
Object
requestObj
)
{
log
.
info
(
"REQ:{}"
,
JSONObject
.
toJSONString
(
requestObj
));
// 自动序列化 requestObj 为 JSON,并设置 Content-Type: application/json
// 自动序列化 requestObj 为 JSON,并设置 Content-Type: application/json
RestTemplate
restTemplate
=
new
RestTemplate
();
RestTemplate
restTemplate
=
new
RestTemplate
();
ResponseEntity
<
String
>
resp
=
restTemplate
.
postForEntity
(
URL
,
requestObj
,
String
.
class
);
ResponseEntity
<
String
>
resp
=
restTemplate
.
postForEntity
(
URL
,
requestObj
,
String
.
class
);
...
@@ -45,6 +49,7 @@ public class PddHttpTool {
...
@@ -45,6 +49,7 @@ public class PddHttpTool {
}
}
public
static
String
sendJsonPostGD
(
Object
requestObj
)
{
public
static
String
sendJsonPostGD
(
Object
requestObj
)
{
log
.
info
(
"REQ:{}"
,
JSONObject
.
toJSONString
(
requestObj
));
// 自动序列化 requestObj 为 JSON,并设置 Content-Type: application/json
// 自动序列化 requestObj 为 JSON,并设置 Content-Type: application/json
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
,
requestObj
,
String
.
class
);
...
...
PddServer/src/main/java/org/ta/pddserver/utils/PddSignTool.java
View file @
1152dda6
...
@@ -61,7 +61,7 @@ public class PddSignTool {
...
@@ -61,7 +61,7 @@ public class PddSignTool {
}
}
// 5. 拼接appSecret(注意末尾无&)
// 5. 拼接appSecret(注意末尾无&)
paramStr
.
append
(
secret
);
paramStr
.
append
(
secret
);
log
.
info
(
"string = {}"
,
paramStr
.
toString
());
//
log.info("string = {}", paramStr.toString());
// 6. MD5加密并转大写
// 6. MD5加密并转大写
return
MD5Util
.
encode
(
paramStr
.
toString
()).
toUpperCase
();
return
MD5Util
.
encode
(
paramStr
.
toString
()).
toUpperCase
();
}
}
...
...
PddServer/src/main/java/org/ta/pddserver/xxl/GDOperator.java
View file @
1152dda6
...
@@ -3,12 +3,11 @@ package org.ta.pddserver.xxl;
...
@@ -3,12 +3,11 @@ package org.ta.pddserver.xxl;
import
jakarta.annotation.PostConstruct
;
import
jakarta.annotation.PostConstruct
;
import
jakarta.annotation.Resource
;
import
jakarta.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.ta.pddserver.entity.GDTicketEntity
;
import
org.ta.pddserver.entity.GDTicketEntity
;
import
org.ta.pddserver.model.pddgd.response.GDTicketRepsonse
;
import
org.ta.pddserver.model.pddgd.response.GDTicketRepsonse
;
import
org.ta.pddserver.service.GDTicketService
;
import
org.ta.pddserver.service.impl.GDTicketImpl
;
import
org.ta.pddserver.service.impl.GDTicketImpl
;
import
org.ta.pddserver.utils.PddGDUtil
;
import
org.ta.pddserver.utils.PddGDUtil
;
...
@@ -17,17 +16,13 @@ import java.util.List;
...
@@ -17,17 +16,13 @@ import java.util.List;
@Component
@Component
@Slf4j
@Slf4j
@EnableScheduling
public
class
GDOperator
{
public
class
GDOperator
{
@Resource
@Resource
GDTicketImpl
gdTicketImpl
;
GDTicketImpl
gdTicketImpl
;
@PostConstruct
@Scheduled
(
fixedRate
=
1000
*
60
*
5
,
initialDelay
=
1000
)
// 每5分钟执行一次
public
void
init
(){
getGdTickets
();
}
@Scheduled
(
fixedRate
=
1000
*
60
*
5
)
// 每5分钟执行一次
public
void
getGdTickets
()
{
public
void
getGdTickets
()
{
List
<
GDTicketRepsonse
>
list
=
PddGDUtil
.
getTickets
();
List
<
GDTicketRepsonse
>
list
=
PddGDUtil
.
getTickets
();
log
.
info
(
"{} 工单数量:{}"
,
new
Date
().
toLocaleString
(),
list
.
size
());
log
.
info
(
"{} 工单数量:{}"
,
new
Date
().
toLocaleString
(),
list
.
size
());
...
...
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