|
|
@@ -38,7 +38,7 @@ public class InsertServiceImpl implements InsertService {
|
|
|
// private static final String serverUrl = "http://gw.api.tbsandbox.com/router/rest";
|
|
|
public static final String appKey = "31921866"; // 可替换为您的沙箱环境应用的appKey /* 待修改 */
|
|
|
public static final String appSecret = "7121c52d4c9970ba08bf09e2f525acd0"; // 可替换为您的沙箱环境应用的appSecret /* 待修改 */
|
|
|
-// public static final String sessionKey = "61024291979328cd09f0ba138f79236d66bd313f3364cf148715824"; // 必须替换为沙箱账号授权得到的真实有效sessionKey /* 待修改 */
|
|
|
+ // public static final String sessionKey = "61024291979328cd09f0ba138f79236d66bd313f3364cf148715824"; // 必须替换为沙箱账号授权得到的真实有效sessionKey /* 待修改 */
|
|
|
public static Logger logger = Logger.getLogger(InsertServiceImpl.class);
|
|
|
|
|
|
@Autowired
|
|
|
@@ -72,16 +72,16 @@ public class InsertServiceImpl implements InsertService {
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
- @Scheduled(cron = "0 0 0/1 * * ?")
|
|
|
+ @Scheduled(cron = "0 0 0/1 * * ?")
|
|
|
public void getAllDate() {
|
|
|
|
|
|
// 1.无淘宝自动抓取的 订单 ,则正常备份历史订单
|
|
|
// 有淘宝自动抓取的 订单 ,则调用增量备份
|
|
|
List<Trade> trades = new ArrayList<Trade>();
|
|
|
- String sa_remark = baseDao.queryForObject("select distinct sa_remark from sale where sa_remark ='淘宝自动抓取' ", String.class);
|
|
|
+ String sa_remark = baseDao.queryForObject("select distinct sa_remark from sale where sa_remark ='淘宝自动' ", String.class);
|
|
|
String session_Key = baseDao.queryForObject(" select tb_code from ( select row_number() over( order by tb_date desc ) xuhao , tb_code from tbauthorization ) where xuhao=1 ", String.class);
|
|
|
if (sa_remark == null || sa_remark == "") {
|
|
|
- TaobaoClient client = new DefaultTaobaoClient("http://gw.api.taobao.com/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
+ TaobaoClient client = new DefaultTaobaoClient("http://39.98.201.114:30001/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
TradesSoldGetRequest req = new TradesSoldGetRequest(); //正常备份接口
|
|
|
req.setFields("tid,type,status,payment,orders,rx_audit_status,trades,receiver_name,receiver_mobile,created,buyer_nick,receiver_state" +
|
|
|
",receiver_address,shipping_type,o2o_guide_name,modified,end_time,post_fee,payment,total_fee,consign_time,sku_properties_name");
|
|
|
@@ -109,7 +109,7 @@ public class InsertServiceImpl implements InsertService {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- TaobaoClient client2 = new DefaultTaobaoClient("http://gw.api.taobao.com/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
+ TaobaoClient client2 = new DefaultTaobaoClient("http://39.98.201.114:30001/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
TradesSoldIncrementGetRequest req2 = new TradesSoldIncrementGetRequest(); //增量备份接口
|
|
|
req2.setFields("tid,type,status,payment,orders,rx_audit_status,trades,receiver_name,receiver_mobile,created,buyer_nick,receiver_state" +
|
|
|
",receiver_address,shipping_type,o2o_guide_name,modified,end_time,post_fee,payment,total_fee,consign_time,sku_properties_name");
|
|
|
@@ -168,21 +168,21 @@ public class InsertServiceImpl implements InsertService {
|
|
|
if(trades.get(i).getModified() == null ) {
|
|
|
modified = formatdx.format(trades.get(i).getCreated());
|
|
|
} else {
|
|
|
- modified = formatdx.format(trades.get(i).getModified());
|
|
|
+ modified = formatdx.format(trades.get(i).getModified());
|
|
|
}
|
|
|
|
|
|
String end_time="2020-11-25";
|
|
|
if(trades.get(i).getEndTime() == null ) {
|
|
|
end_time = formatdx.format(trades.get(i).getCreated());
|
|
|
} else {
|
|
|
- end_time = formatdx.format( trades.get(i).getEndTime() );
|
|
|
+ end_time = formatdx.format( trades.get(i).getEndTime() );
|
|
|
}
|
|
|
|
|
|
String consigntime="2020-11-25";
|
|
|
if(trades.get(i).getConsignTime() == null ) {
|
|
|
consigntime = formatdx.format(trades.get(i).getCreated());
|
|
|
} else {
|
|
|
- consigntime = formatdx.format( trades.get(i).getConsignTime() );
|
|
|
+ consigntime = formatdx.format( trades.get(i).getConsignTime() );
|
|
|
}
|
|
|
|
|
|
if(trades.get(i).getConsignTime() == null ) {
|