Commit a98789f0 authored by Quxl's avatar Quxl

x

parent 92ed3758
......@@ -4,6 +4,8 @@ import java.util.Date;
import java.util.HashMap;
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.Value;
import org.springframework.scheduling.annotation.Scheduled;
......@@ -18,6 +20,8 @@ import com.egolm.pds.schedule.service.PdsService;
@Component
public class ProductsTask {
private static final Log log = LogFactory.getLog(ProductsTask.class);
@Autowired
private PdsService pdsService;
......@@ -33,7 +37,7 @@ public class ProductsTask {
@Scheduled(cron="${pds.cron.products_download}")
public void execute() {
System.out.println(DateUtil.format(new Date()) + " PdsProductsUpdateTask RUN");
log.debug(DateUtil.format(new Date()) + " PdsProductsUpdateTask RUN");
boolean boo = true;
int loopCount = 0;
while(boo) {
......
package com.egolm.pds.schedule.service;
import java.util.Date;
import java.util.HashMap;
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.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON;
import com.egolm.common.DateUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.pds.config.HttpUtil;
@Component
public class PdsService {
private static final Log log = LogFactory.getLog(PdsService.class);
@Autowired
private JdbcTemplate jdbcTemplate;
......@@ -31,7 +33,7 @@ public class PdsService {
@Transactional
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);
Map<String, String> headers = new HashMap<String, String>();
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