Commit 47958582 by 王栋源

wdy

parent 61578bff
......@@ -3,8 +3,8 @@ const System = require("../../system");
const request = require('request');
const fs = require('fs');
// this.fqReqUrl = "https://yunfuapi.gongsibao.com";//线上域名
let fqReqUrl = "https://yunfuapi-dev.gongsibao.com";//dev域名
let fqReqUrl = "https://yunfuapi.gongsibao.com";//线上域名
// let fqReqUrl = "https://yunfuapi-dev.gongsibao.com";//dev域名
//推送tm等信息到指定接口(每回需要推送200条)
class TmInfoPusherApi {
......@@ -15,7 +15,7 @@ class TmInfoPusherApi {
async collectInfo() {
try{
try {
//根据状态判断获取商标数据、根据商标数据获取申请人信息、联系人信息、官文信息
//获取商标数据
......@@ -24,12 +24,12 @@ class TmInfoPusherApi {
let oneItem = {};
for(let i=0;i<resultTm.length;i++) {
for (let i = 0; i < resultTm.length; i++) {
let d = resultTm[i];
let orderNum = d.orderNum;
let tmRegistNum = d.tmRegistNum;
let order_no = d.channelOrderListInfo;
oneItem.tm = d;
//商标状态
oneItem.tmStatusName = d.tmStatusName;
......@@ -58,29 +58,29 @@ class TmInfoPusherApi {
body: JSON.stringify({
'order_no': order_no,
'json': oneItem
})
};
})
};
let res = await this.reqPost(options);
console.log('推送完成--' + i, res);
//更新isPushed字段为1
await this.trademarkS.updateIsPushed(d.id);
console.log('更新isPushed字段完成--', i);
}
return {code: 200, message: "调用推送接口成功"};
}catch(e) {
return { code: 200, message: "调用推送接口成功" };
} catch (e) {
console.log('collectInfo error: ', e);
return e;
}
}
async reqPost(options) {
return new Promise((resolve, reject)=>{
return new Promise((resolve, reject) => {
request(options, (e, response, body) => {
if(e) {
if (e) {
console.log('请求igirl接口错误:', e);
reject(e);
}
......
......@@ -2,8 +2,8 @@ const Client = require('aliyun-api-gateway').Client;
// const client = new Client('203727307', 'b6za34qem6k9a3s3jguvh24nc3ridlnh');
const client = new Client('203732072', '3r0dn583041bco48lq0xgsw09r0hh6ew');
// const clientig = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');//开发
const clientig = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');//线上
const clientig = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');//开发
//const clientig = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');//线上
class aliyunClient {
constructor() {
this.aliReqUrl = "https://aliapi.gongsibao.com/tm/springboard";
......
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