Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pdstask
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
曲欣亮
pdstask
Commits
a98789f0
Commit
a98789f0
authored
Oct 16, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
92ed3758
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
ProductsTask.java
src/main/java/com/egolm/pds/schedule/ProductsTask.java
+5
-1
PdsService.java
src/main/java/com/egolm/pds/schedule/service/PdsService.java
+5
-3
No files found.
src/main/java/com/egolm/pds/schedule/ProductsTask.java
View file @
a98789f0
...
@@ -4,6 +4,8 @@ import java.util.Date;
...
@@ -4,6 +4,8 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -18,6 +20,8 @@ import com.egolm.pds.schedule.service.PdsService;
...
@@ -18,6 +20,8 @@ import com.egolm.pds.schedule.service.PdsService;
@Component
@Component
public
class
ProductsTask
{
public
class
ProductsTask
{
private
static
final
Log
log
=
LogFactory
.
getLog
(
ProductsTask
.
class
);
@Autowired
@Autowired
private
PdsService
pdsService
;
private
PdsService
pdsService
;
...
@@ -33,7 +37,7 @@ public class ProductsTask {
...
@@ -33,7 +37,7 @@ public class ProductsTask {
@Scheduled
(
cron
=
"${pds.cron.products_download}"
)
@Scheduled
(
cron
=
"${pds.cron.products_download}"
)
public
void
execute
()
{
public
void
execute
()
{
System
.
out
.
println
(
DateUtil
.
format
(
new
Date
())
+
" PdsProductsUpdateTask RUN"
);
log
.
debug
(
DateUtil
.
format
(
new
Date
())
+
" PdsProductsUpdateTask RUN"
);
boolean
boo
=
true
;
boolean
boo
=
true
;
int
loopCount
=
0
;
int
loopCount
=
0
;
while
(
boo
)
{
while
(
boo
)
{
...
...
src/main/java/com/egolm/pds/schedule/service/PdsService.java
View file @
a98789f0
package
com
.
egolm
.
pds
.
schedule
.
service
;
package
com
.
egolm
.
pds
.
schedule
.
service
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.egolm.common.DateUtil
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.pds.config.HttpUtil
;
import
com.egolm.pds.config.HttpUtil
;
@Component
@Component
public
class
PdsService
{
public
class
PdsService
{
private
static
final
Log
log
=
LogFactory
.
getLog
(
PdsService
.
class
);
@Autowired
@Autowired
private
JdbcTemplate
jdbcTemplate
;
private
JdbcTemplate
jdbcTemplate
;
...
@@ -31,7 +33,7 @@ public class PdsService {
...
@@ -31,7 +33,7 @@ public class PdsService {
@Transactional
@Transactional
public
void
savePdsProduct
(
Object
transactionId
,
Map
<
String
,
Object
>
productMap
)
{
public
void
savePdsProduct
(
Object
transactionId
,
Map
<
String
,
Object
>
productMap
)
{
System
.
out
.
println
(
DateUtil
.
format
(
new
Date
())
+
" PDS Save >>"
+
transactionId
+
" "
+
JSON
.
toJSONString
(
productMap
));
log
.
debug
(
transactionId
+
" "
+
JSON
.
toJSONString
(
productMap
));
jdbcTemplate
.
save
(
"pds_article"
,
productMap
);
jdbcTemplate
.
save
(
"pds_article"
,
productMap
);
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
authKey
,
authValue
);
headers
.
put
(
authKey
,
authValue
);
...
...
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