|
|
@@ -85,6 +85,9 @@ public class InsertServiceImpl implements InsertService {
|
|
|
|
|
|
//String session_Key = baseDao.queryForObject(" select tb_code from ( select row_number() over(partition by TB_OPENUID order by tb_date desc ) xuhao , tb_code from tbauthorization ) where xuhao=1 ", String.class);
|
|
|
List<Map<String,Object>> list = baseDao.queryForList(" select tb_code from ( select row_number() over(partition by TB_OPENUID order by tb_date desc ) xuhao , tb_code from tbauthorization ) where xuhao=1");
|
|
|
+
|
|
|
+ List<Long> saleIDS =new ArrayList<>();
|
|
|
+ List<String> insertSqlsList = new ArrayList<String>();
|
|
|
for (int z = 0; z < list.size(); z++) {
|
|
|
String session_Key = list.get(z).get("tb_code").toString();
|
|
|
|
|
|
@@ -139,7 +142,7 @@ public class InsertServiceImpl implements InsertService {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- TaobaoClient client2 = new DefaultTaobaoClient("http://39.98.201.114:30001/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
+ TaobaoClient client2 = new DefaultTaobaoClient("http://gw.api.taobao.com/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
TradesSoldIncrementGetRequest req2 = new TradesSoldIncrementGetRequest(); //增量备份接口
|
|
|
req2.setFields("total_results,has_next,trades,seller_nick,pic_path,payment,seller_rate,post_fee,receiver_name,receiver_state,receiver_address,receiver_zip,receiver_mobile"+
|
|
|
",receiver_phone,consign_time,received_payment,receiver_country,receiver_town,order_tax_fee,shop_pick,tid,num,num_iid,status,title,type,price,discount_fee"+
|
|
|
@@ -183,13 +186,13 @@ public class InsertServiceImpl implements InsertService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- List<String> insertSqlsList = new ArrayList<String>();
|
|
|
+
|
|
|
|
|
|
if (trades ==null || trades.size() == 0) {
|
|
|
logger.info(this.getClass() + " 未录入淘宝订单 ");
|
|
|
} else {
|
|
|
int L=0;
|
|
|
- List<Long> saleIDS =new ArrayList<>();
|
|
|
+
|
|
|
for (int i = 0; i < trades.size(); i++) {
|
|
|
|
|
|
/* 插入淘宝订单ID sa_tradeid 字段 alter table sale add sa_tradeid number; */
|
|
|
@@ -243,7 +246,7 @@ public class InsertServiceImpl implements InsertService {
|
|
|
obj3.setTid(tid6);
|
|
|
obj3.setScene("1001");
|
|
|
req6.setQueryList(list2);
|
|
|
- TaobaoClient client6 = new DefaultTaobaoClient("http://39.98.201.114:30001/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
+ TaobaoClient client6 = new DefaultTaobaoClient("http://gw.api.taobao.com/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
String name_oaid=trimNull(trades.get(i).getReceiverName() );
|
|
|
String receiver_mobile=trimNull(trades.get(i).getReceiverMobile() );
|
|
|
String address=trimNull(trades.get(i).getReceiverState() ) + trimNull(trades.get(i).getReceiverCity() ) + trimNull(trades.get(i).getReceiverDistrict() ) + trimNull( trades.get(i).getReceiverAddress() );
|
|
|
@@ -255,6 +258,7 @@ public class InsertServiceImpl implements InsertService {
|
|
|
name_oaid=rsp6.getReceiverList().get(0).getName();
|
|
|
receiver_mobile=rsp6.getReceiverList().get(0).getMobile();
|
|
|
address=trimNull(rsp6.getReceiverList().get(0).getState() ) + trimNull(rsp6.getReceiverList().get(0).getCity() ) + trimNull(rsp6.getReceiverList().get(0).getDistrict() ) + trimNull( rsp6.getReceiverList().get(0).getAddressDetail() );
|
|
|
+// rsp6.getReceiverList().get(1
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
logger.info(new SimpleDateFormat("YYYY-MM-DD hh24:mm:ss").format(new Date()) + this.getClass() + "淘宝未返回敏感数据");
|
|
|
@@ -294,23 +298,26 @@ public class InsertServiceImpl implements InsertService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- try{
|
|
|
- baseDao.execute(insertSqlsList);
|
|
|
- if(saleIDS.size()>0) {
|
|
|
- baseDao.callProcedure("SP_UPDATE_SALE", StringUtils.join(saleIDS, ','));
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
- }catch (Exception e) {
|
|
|
- logger.info( e.getMessage() );
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
logger.info(this.getClass() + "插入销售明细成功");
|
|
|
}
|
|
|
+ try{
|
|
|
+ baseDao.execute(insertSqlsList);
|
|
|
+ if(saleIDS.size()>0) {
|
|
|
+ String IDSTEST=StringUtils.join(saleIDS, ',') ;
|
|
|
+ baseDao.callProcedure("SP_UPDATE_SALE", StringUtils.join(saleIDS, ','));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ }catch (Exception e) {
|
|
|
+ logger.info( e.getMessage() );
|
|
|
+ }
|
|
|
+ logger.info(this.getClass() + "插入所有销售明细成功");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|