Commit a98789f0 authored by Quxl's avatar Quxl

x

parent 92ed3758
...@@ -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;
...@@ -19,6 +21,8 @@ import com.egolm.pds.schedule.service.PdsService; ...@@ -19,6 +21,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) {
......
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment