|
|
@@ -1,6 +1,8 @@
|
|
|
package com.uas.eis.serviceImpl;
|
|
|
|
|
|
-
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.taobao.api.DefaultTaobaoClient;
|
|
|
import com.taobao.api.TaobaoClient;
|
|
|
import com.taobao.api.domain.Order;
|
|
|
@@ -8,9 +10,9 @@ import com.taobao.api.domain.Trade;
|
|
|
import com.taobao.api.internal.util.StringUtils;
|
|
|
import com.uas.eis.dao.BaseDao;
|
|
|
import com.uas.eis.service.InsertService;
|
|
|
-import net.sf.json.JSON;
|
|
|
-import net.sf.json.JSONArray;
|
|
|
-import net.sf.json.JSONObject;
|
|
|
+//import net.sf.json.JSON;
|
|
|
+//import net.sf.json.JSONArray;
|
|
|
+//import net.sf.json.JSONObject;
|
|
|
import oracle.sql.DATE;
|
|
|
import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -73,241 +75,74 @@ public class InsertServiceImpl implements InsertService {
|
|
|
return str.trim();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+//定时任务2小时
|
|
|
@Autowired
|
|
|
- @Scheduled(cron = "0 0/8 * * * ?")
|
|
|
+ @Scheduled(cron = "0 0 0/2 * * ?")
|
|
|
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);
|
|
|
-
|
|
|
+ //数据对接至美的https://gsc.midea.com/gscapp/supplierInventoryInterface/doImport
|
|
|
+ //A0001309
|
|
|
+ //LYDF@890cdopBD
|
|
|
+ Map<String, Object> dataMaps = new HashMap<>();
|
|
|
+ List<Map<String,Object>> list = baseDao.queryForList(" select to_char(sysdate,'yyyyMMdd')||UUID_SEQ.nextval UUID,pc_custprodcode,pc_mdname_user,qty from prodmdedi_view left join mdkc_vies on pc_prodcode=ba_prodcode");
|
|
|
+
|
|
|
+ //timestamp 是 long 当前时间戳 当前时间戳
|
|
|
+ long timestamp = System.currentTimeMillis();
|
|
|
+ dataMaps.put("timestamp",timestamp);
|
|
|
+ //?? serialnum 是 String 流水号 流水号(数据批次号),建议9位数字流水号
|
|
|
+ dataMaps.put("serialnum",list.get(0).get("UUID").toString());
|
|
|
+ //vendorCode 是 String 供应商编码 供应商编码,美的系统供应商编码,比如:A0001523
|
|
|
+ dataMaps.put("vendorCode","A0001309");
|
|
|
+ //token 是 String token 供应商密钥(联系美的IT提供)
|
|
|
+ dataMaps.put("token","LYDF@890cdopBD");
|
|
|
+ //data 是 List<Object> 具体数据 交易具体数据,是一个对象集合,每个对象格式请查看下面字段
|
|
|
+ List<Map<String, Object>> datas = new LinkedList<Map<String, Object>>();
|
|
|
//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");
|
|
|
- for (int z = 0; z < list.size(); z++) {
|
|
|
- String session_Key = list.get(z).get("tb_code").toString();
|
|
|
-
|
|
|
- if (sa_remark == null || sa_remark == "") {
|
|
|
- TaobaoClient client = new DefaultTaobaoClient("http://39.98.201.114:30001/router/rest", "31921866", "7121c52d4c9970ba08bf09e2f525acd0");
|
|
|
- TradesSoldGetRequest req = new TradesSoldGetRequest(); //正常备份接口
|
|
|
- req.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"+
|
|
|
- ",total_fee,created,pay_time,modified,end_time,seller_flag,buyer_nick,has_buyer_message,credit_card_fee,step_trade_status,step_paid_fee,mark_desc,shipping_type"+
|
|
|
- ",adjust_fee,trade_from"+
|
|
|
- ",service_orders,oid,item_oid,service_id,service_detail_url,num,price,payment,title,total_fee,buyer_nick,refund_id,seller_nick,pic_path"+
|
|
|
- ",tmser_spu_code,oid_str,buyer_rate,receiver_city,receiver_district,o2o,o2o_guide_id,o2o_delivery,"+
|
|
|
- ",orders,item_meal_name,pic_path,seller_nick,buyer_nick,refund_status,outer_iid,snapshot_url,snapshot,timeout_action_time,buyer_rate,seller_rate"+
|
|
|
- ",seller_type,cid,sub_order_tax_fee,sub_order_tax_rate,oid,status,title,item_oid,type,sku_properties_name,order_attr,shipping_type"+
|
|
|
- ",md_qualification,customization,inv_type,shipper,f_type,f_status,f_term,assembly_rela,cl_down_payment,cl_month_payment,cl_tail_payment"+
|
|
|
- ",cl_installment_num,cal_penalty,cl_service_fee,cl_car_taker,cl_car_taker_phone,cl_car_taker_i_d_num,cl_car_taker_id_num,down_payment"+
|
|
|
- ",down_payment_ratio,month_payment,tail_payment,installment_num,penalty,service_fee,oid_str,nr_reduce_inv_fail,sort_info"+
|
|
|
- ",rt_omni_outer_sc_id,rt_omni_sc_id,modify_address,ti_modify_address_time,omni_jxs_outerid,propoint,brand_light_shop_source,special_refund_type"+
|
|
|
- ",extend_info,service_type,threepl_timing,is_o2o_passport,delivery_time,sign_time");
|
|
|
-
|
|
|
-
|
|
|
- Calendar calendar3 = Calendar.getInstance();
|
|
|
- calendar3.setTime(new Date());
|
|
|
-
|
|
|
- calendar3.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
- calendar3.set(Calendar.MINUTE, 0);
|
|
|
- calendar3.set(Calendar.SECOND, 0);
|
|
|
- calendar3.add(calendar3.DATE,-2);
|
|
|
- Date zero3 = calendar3.getTime();
|
|
|
-// req.setStartCreated(StringUtils.parseDateTime("2020-01-05 00:00:00"));
|
|
|
-
|
|
|
- Date date = new Date();
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- calendar.setTime(new Date());
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 23);
|
|
|
- calendar.set(Calendar.MINUTE, 59);
|
|
|
- calendar.set(Calendar.SECOND, 59);
|
|
|
- Date endtime = calendar.getTime();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- req.setStartCreated(zero3);
|
|
|
- req.setEndCreated(endtime);
|
|
|
-
|
|
|
- try {
|
|
|
- TradesSoldGetResponse rsp = client.execute(req, session_Key);
|
|
|
- trades = rsp.getTrades();
|
|
|
- } catch (Exception e) {
|
|
|
-
|
|
|
- //logger.info( new SimpleDateFormat("YYYY-MM-DD hh24:mi:ss").format(new Date())+ this.getClass() + "淘宝未响应并返回订单数据");
|
|
|
- logger.info("淘宝未响应并返回订单数据");
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- TaobaoClient client2 = new DefaultTaobaoClient("http://39.98.201.114:30001/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"+
|
|
|
- ",total_fee,created,pay_time,modified,end_time,seller_flag,buyer_nick,has_buyer_message,credit_card_fee,step_trade_status,step_paid_fee,mark_desc,shipping_type"+
|
|
|
- ",adjust_fee,trade_from"+
|
|
|
- ",service_orders,oid,item_oid,service_id,service_detail_url,num,price,payment,title,total_fee,buyer_nick,refund_id,seller_nick,pic_path"+
|
|
|
- ",tmser_spu_code,oid_str,buyer_rate,receiver_city,receiver_district,o2o,o2o_guide_id,o2o_delivery,"+
|
|
|
- ",orders,item_meal_name,pic_path,seller_nick,buyer_nick,refund_status,outer_iid,snapshot_url,snapshot,timeout_action_time,buyer_rate,seller_rate"+
|
|
|
- ",seller_type,cid,sub_order_tax_fee,sub_order_tax_rate,oid,status,title,item_oid,type,sku_properties_name,order_attr,shipping_type"+
|
|
|
- ",md_qualification,customization,inv_type,shipper,f_type,f_status,f_term,assembly_rela,cl_down_payment,cl_month_payment,cl_tail_payment"+
|
|
|
- ",cl_installment_num,cal_penalty,cl_service_fee,cl_car_taker,cl_car_taker_phone,cl_car_taker_i_d_num,cl_car_taker_id_num,down_payment"+
|
|
|
- ",down_payment_ratio,month_payment,tail_payment,installment_num,penalty,service_fee,oid_str,nr_reduce_inv_fail,sort_info"+
|
|
|
- ",rt_omni_outer_sc_id,rt_omni_sc_id,modify_address,ti_modify_address_time,omni_jxs_outerid,propoint,brand_light_shop_source,special_refund_type"+
|
|
|
- ",extend_info,service_type,threepl_timing,is_o2o_passport,delivery_time,sign_time");
|
|
|
-
|
|
|
-
|
|
|
- Date date2 = new Date();
|
|
|
- Calendar calendar2 = Calendar.getInstance();
|
|
|
- calendar2.setTime(new Date());
|
|
|
-
|
|
|
- calendar2.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
- calendar2.set(Calendar.MINUTE, 0);
|
|
|
- calendar2.set(Calendar.SECOND, 0);
|
|
|
- Date zero = calendar2.getTime();
|
|
|
-
|
|
|
- req2.setStartModified(zero);
|
|
|
-// req2.setStartModified(StringUtils.parseDateTime("2020-01-05 00:00:00"));
|
|
|
- calendar2.set(Calendar.HOUR_OF_DAY, 23);
|
|
|
- calendar2.set(Calendar.MINUTE, 59);
|
|
|
- calendar2.set(Calendar.SECOND, 59);
|
|
|
- Date endtime = calendar2.getTime();
|
|
|
-
|
|
|
- req2.setEndModified(endtime);
|
|
|
-// req2.setEndModified(StringUtils.parseDateTime("2020-01-05 23:59:59"));
|
|
|
- try {
|
|
|
- TradesSoldIncrementGetResponse rsp2 = client2.execute(req2, session_Key);
|
|
|
- trades = rsp2.getTrades();
|
|
|
- } catch (Exception e) {
|
|
|
- logger.info(this.getClass() + "淘宝未响应并返回订单数据");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- List<String> insertSqlsList = new ArrayList<String>();
|
|
|
|
|
|
- if (trades ==null || trades.size() == 0) {
|
|
|
- logger.info(this.getClass() + " 未录入淘宝订单 ");
|
|
|
- } else {
|
|
|
- int L=0;
|
|
|
- for (int i = 0; i < trades.size(); i++) {
|
|
|
-
|
|
|
- /* 插入淘宝订单ID sa_tradeid 字段 alter table sale add sa_tradeid number; */
|
|
|
-
|
|
|
- Long said = baseDao.queryForObject("select sale_seq.nextval from dual", Long.class);
|
|
|
-
|
|
|
- String sa_code = baseDao.sGetMaxNumber("Sale", 2);
|
|
|
- SimpleDateFormat formatdx = new SimpleDateFormat("yyyy-MM-dd HH:MM:ss");
|
|
|
- String createdtime="2020-11-25";
|
|
|
- if(trades.get(i).getCreated() == null ) {
|
|
|
- createdtime = formatdx.format(new DATE());
|
|
|
-
|
|
|
- } else {
|
|
|
- createdtime = formatdx.format(trades.get(i).getCreated());
|
|
|
- }
|
|
|
-
|
|
|
- String modified="2020-11-25";
|
|
|
- if(trades.get(i).getModified() == null ) {
|
|
|
- modified = formatdx.format(trades.get(i).getCreated());
|
|
|
- } else {
|
|
|
- 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() );
|
|
|
- }
|
|
|
-
|
|
|
- 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() );
|
|
|
- }
|
|
|
-
|
|
|
- if(trades.get(i).getConsignTime() == null ) {
|
|
|
- consigntime = formatdx.format(trades.get(i).getCreated());
|
|
|
- } else {
|
|
|
- consigntime = formatdx.format( trades.get(i).getConsignTime() );
|
|
|
- }
|
|
|
-//0819
|
|
|
- String oaid=trades.get(i).getOaid();
|
|
|
- String tid6=trades.get(i).getTid().toString();
|
|
|
- TopOaidDecryptRequest req6 = new TopOaidDecryptRequest();
|
|
|
- List<TopOaidDecryptRequest.ReceiverQuery> list2 = new ArrayList<TopOaidDecryptRequest.ReceiverQuery>();
|
|
|
- TopOaidDecryptRequest.ReceiverQuery obj3 = new TopOaidDecryptRequest.ReceiverQuery();
|
|
|
- list2.add(obj3);
|
|
|
- obj3.setOaid(oaid);
|
|
|
- obj3.setTid(tid6);
|
|
|
- obj3.setScene("1001");
|
|
|
- req6.setQueryList(list2);
|
|
|
- TaobaoClient client6 = new DefaultTaobaoClient("http://39.98.201.114:30001/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() );
|
|
|
-
|
|
|
-
|
|
|
- if(oaid!=null) {
|
|
|
- try {
|
|
|
- TopOaidDecryptResponse rsp6 = client6.execute(req6, session_Key);
|
|
|
- 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() );
|
|
|
- } catch (Exception e) {
|
|
|
-
|
|
|
- logger.info(new SimpleDateFormat("YYYY-MM-DD hh24:mi:ss").format(new Date()) + this.getClass() + "淘宝未返回敏感数据");
|
|
|
- }
|
|
|
- }
|
|
|
-//
|
|
|
-
|
|
|
-
|
|
|
- String INSERTSALESql = "insert into sale( SA_ISUPDATE,SA_DISCOUNTFEE,SA_TRADESTATUS, sa_sellernick,sa_custcode,sa_paymentscode,SA_TAOBAOID,sa_payments,sa_custname,sa_kind,sa_wwh_user,sa_need15,sa_id,sa_tradeid,sa_code,sa_date,sa_recorder,sa_recorddate,sa_currency,sa_rate" +
|
|
|
- ",sa_apcustname,sa_need9,sa_toplace" +
|
|
|
- ",sa_transport,sa_seller,sa_updatedate" +
|
|
|
- ",sa_enddate,sa_statuscode,sa_status,sa_fare,sa_total" +
|
|
|
- ",sa_recamount,sa_plandelivery,sa_printstatuscode,sa_remark)" +
|
|
|
- " SELECT 1,"+trades.get(i).getDiscountFee() +",'"+trimNull(trades.get(i).getStatus() )+"','" + trimNull(trades.get(i).getSellerNick() ) + " ', 'GN0008358','P001', " + trades.get(i).getTid() + " , '现结','HLK淘宝','国内标准销售订单', ' " +trimNull( name_oaid ) + " ' , ' " + trimNull( receiver_mobile ) + " ' , " + said + "," + trades.get(i).getTid() + "," + trades.get(i).getTid()
|
|
|
- + " , to_date ( '" + end_time + "' ,'YYYY-MM-DD hh24:mi:ss') , '管理员',sysdate,'RMB','1','"
|
|
|
- + trimNull(name_oaid )+ "','" + trimNull( trades.get(i).getBuyerNick() )+ "','" + address + " ', ' "
|
|
|
- + trimNull( trades.get(i).getShippingType() ) + " ', ' " + trimNull (trades.get(i).getO2oGuideName() ) + " ', to_date ( '" + modified
|
|
|
- + "','YYYY-MM-DD hh24:mi:ss') , to_date ( '" +end_time + "','YYYY-MM-DD hh24:mi:ss') ,'ENTERING','在录入'," + trimNull( trades.get(i).getPostFee() )+ "," +trimNull( trades.get(i).getPayment() ) + ","
|
|
|
- + trimNull(trades.get(i).getPayment() ) + " , to_date ( '" +consigntime + "','YYYY-MM-DD hh24:mi:ss') ,'unprint', '淘宝自动抓取' FROM DUAL " +
|
|
|
- " WHERE '" + trimNull(trades.get(i).getStatus() ) + "' NOT IN ( 'TRADE_NO_CREATE_PAY','WAIT_BUYER_PAY','PAY_PENDING' ) AND NOT EXISTS ( select sa_id from sale WHERE SA_iD=" + said + " ) AND NOT EXISTS ( select SA_CODE from sale WHERE SA_CODE= '" + trades.get(i).getTid() + "' ) AND NOT EXISTS ( select SA_TAOBAOID from sale WHERE SA_TAOBAOID=" + trades.get(i).getTid() + " ) ";
|
|
|
- insertSqlsList.add(INSERTSALESql);
|
|
|
-
|
|
|
- List<Order> orders = trades.get(i).getOrders();
|
|
|
- for (int j = 0; j < orders.size(); j++) {
|
|
|
- int k = j + 1;
|
|
|
- L++;
|
|
|
-
|
|
|
- Long sdid = baseDao.queryForObject("select saledetail_seq.nextval from dual", Long.class);
|
|
|
-
|
|
|
- String INSERTSALEDETAILSql = "insert into saledetail(SD_PROPERTIES,sd_remark,sd_id,sd_said,sd_code,sd_detno,sd_prodcode,sd_qty,sd_price,sd_total" +
|
|
|
- ",sd_statuscode,sd_status,sd_discount,SD_DIVIDE_ORDER_FEE,SD_PART_MJZ_DISCOUNT )" +
|
|
|
- " SELECT ' " + trimNull ( orders.get(j).getSkuPropertiesName() ) + " ' , ' " + orders.get(j).getTitle() + " ' , " + sdid + " ," + said + " ,' " + sdid + " '," + k + ",'" + trimNull(orders.get(j).getOuterIid()) + "'," + orders.get(j).getNum() + "," + orders.get(j).getPrice() + " ," + orders.get(j).getPayment() +
|
|
|
- ",'ENTERING','在录入', " + orders.get(j).getDiscountFee() +","+orders.get(j).getDivideOrderFee() +","+orders.get(j).getPartMjzDiscount() + " FROM DUAL WHERE NOT EXISTS ( select sd_id from saledetail " +
|
|
|
- "WHERE '" + trimNull(trades.get(i).getStatus() ) + "' NOT IN ( 'TRADE_NO_CREATE_PAY','WAIT_BUYER_PAY','PAY_PENDING' ) AND sd_id=" + sdid + " ) AND NOT EXISTS ( select sd_id from sale left join saledetail on sa_id=sd_said " +
|
|
|
- "WHERE SA_TAOBAOID = " + trades.get(i).getTid() + " and sd_detno = " + k +" ) ";
|
|
|
- insertSqlsList.add(INSERTSALEDETAILSql);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- System.out.println(insertSqlsList);
|
|
|
- try{
|
|
|
- baseDao.execute(insertSqlsList);
|
|
|
- baseDao.callProcedure("SP_UPDATE_SALE");
|
|
|
+ for (int z = 0; z < list.size(); z++) {
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
+ //??sourceId 是 String 供方系统数据id 数据唯一标识,每个供应商每个id数据只允许推送一次,重复会返回有重复数据(建议用uuid,可以百度uuid)
|
|
|
+ data.put("sourceId",list.get(z).get("pc_custprodcode").toString());
|
|
|
+ //-demandItemCode 是 String 美的物料编码 美的物料编码必须要有数据 //客户物料编码
|
|
|
+ data.put("demandItemCode",list.get(z).get("pc_custprodcode").toString());
|
|
|
+ //-organizationCode 是 String 库存组织编码 美的系统库存组织代码,比如:M01
|
|
|
+ data.put("organizationCode",list.get(z).get("pc_mdname_user").toString());
|
|
|
+ //-qty 是 BigDecimal 数量 数量大于或等于0
|
|
|
+ data.put("qty",Integer.parseInt(list.get(z).get("qty").toString() ));
|
|
|
+ //-supplyItemCode 否 String 供方物料编码 供方系统的物料编码
|
|
|
+ //-itemDescription 否 String 物料描述 物料描述
|
|
|
+ //-transactionDate 否 String 交易时间 如果为空,系统默认为当前时间
|
|
|
+ data.put("transactionDate",list.get(z).get("pc_custprodcode").toString());
|
|
|
+ //-reference 否 String 备注信息 备注信息
|
|
|
+ //-sourceBill 否 String 来源单据
|
|
|
+ datas.add(data);
|
|
|
+ }
|
|
|
+ dataMaps.put("data",datas);
|
|
|
+//正式接口https://gsc.midea.com/gscapp/supplierInventoryInterface/doImport
|
|
|
|
|
|
- }catch (Exception e) {
|
|
|
- logger.info( e.getMessage() );
|
|
|
- }
|
|
|
+ try {
|
|
|
+ Response response = HttpUtil.doPost("https://gscuat.midea.com/gscapp/supplierInventoryInterface/doImport",
|
|
|
+ JSON.toJSONString(dataMaps), false, "NoSign");
|
|
|
+ String responseText = response.getResponseText();
|
|
|
+ com.alibaba.fastjson.JSONObject parseObject = JSONArray.parseObject(responseText);
|
|
|
+ String responseCode = parseObject.getString("code");
|
|
|
+ String err = parseObject.getString("message");
|
|
|
+ logger.info(this.getClass() + "对接美的成功");
|
|
|
+// if (response.getStatusCode() == HttpStatus.OK.value()) {
|
|
|
+// onInquiryUploadSuccess(idStr);
|
|
|
+// onInquiryDetailUploadSuccess(ids);
|
|
|
+// } else
|
|
|
|
|
|
- }
|
|
|
+ } catch (Exception e) {
|
|
|
+ baseDao.execute("insert into " +
|
|
|
+ "messagelog (ML_ID, ML_DATE, ML_MAN, ML_CONTENT, ML_RESULT) values " +
|
|
|
+ "(messagelog_seq.nextval,to_char(sysdate,'yyyy-MM-dd hh24:mm:mi'),'超级管理员',"+timestamp+",'对接美的失败')");
|
|
|
|
|
|
+ logger.info( e.getMessage() );
|
|
|
|
|
|
- logger.info(this.getClass() + "插入销售明细成功");
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|