Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
49e74a45
Commit
49e74a45
authored
May 25, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Plain Diff
wdy
parents
47958582
facd501a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
29 deletions
+34
-29
fqboss/app/base/api/impl/tmInfoPusherApi.js
+27
-28
fqboss/app/base/service/impl/tmflowSve.js
+2
-0
fqboss/app/base/utils/aliyunClient.js
+4
-0
fqboss/app/config/localsettings.js
+1
-1
No files found.
fqboss/app/base/api/impl/tmInfoPusherApi.js
View file @
49e74a45
const
ApiBase
=
require
(
"../api.base"
);
const
System
=
require
(
"../../system"
);
const
request
=
require
(
'request'
);
const
fs
=
require
(
'fs'
);
const
aliyunClient
=
require
(
'../../utils/aliyunClient.js'
);
const
OplogSve
=
require
(
'../../service/impl/oplogSve.js'
);
let
fqReqUrl
=
"https://yunfuapi.gongsibao.com"
;
//线上域名
// let fqReqUrl = "https://yunfuapi-dev.gongsibao.com";//dev域名
...
...
@@ -11,12 +13,12 @@ class TmInfoPusherApi {
constructor
()
{
this
.
trademarkS
=
System
.
getObject
(
"service.trademarkSve"
);
this
.
tmapplierinfoDao
=
System
.
getObject
(
"db.tmapplierinfoDao"
);
this
.
aliyunClient
=
new
aliyunClient
();
this
.
oplogSve
=
new
OplogSve
();
};
async
collectInfo
()
{
try
{
//根据状态判断获取商标数据、根据商标数据获取申请人信息、联系人信息、官文信息
//获取商标数据
let
resultTm
=
await
this
.
trademarkS
.
queryTmInfoForPush
();
...
...
@@ -42,27 +44,29 @@ class TmInfoPusherApi {
let
resultTmCustomer
=
await
this
.
trademarkS
.
queryTmCustomerInfoForPush
(
orderNum
);
oneItem
.
tmCustomer
=
resultTmCustomer
[
0
];
//获取官文信息, 一对多的关系,所以传入list
let
resultTmFlow
=
await
this
.
trademarkS
.
queryTmFlowInfoForPush
(
tmRegistNum
);
oneItem
.
tmFlow
=
resultTmFlow
;
console
.
log
(
'收集商标信息完成--'
,
i
);
//调用推送接口推送oneItem
var
options
=
{
'method'
:
'POST'
,
'url'
:
fqReqUrl
+
':/cloudapi/iduty/igirl/pushFollowUp'
,
'headers'
:
{
},
body
:
JSON
.
stringify
({
'order_no'
:
order_no
,
'json'
:
oneItem
})
let
url
=
fqReqUrl
+
'/cloudapi/iduty/igirl/pushFollowUp'
;
let
body
=
{
'order_no'
:
order_no
,
'json'
:
oneItem
};
let
res
=
await
this
.
reqPost
(
options
);
let
res
=
await
this
.
aliyunClient
.
postig
(
url
,
body
);
console
.
log
(
'推送完成--'
+
i
,
res
);
//将成功结果写入到日志
await
this
.
oplogSve
.
create
({
logLevel
:
"info"
,
optitle
:
"推送商标数据至蜂擎---"
,
op
:
"app/base/api/impl/tmInfoPusherApi.js/collectInfo"
,
content
:
"参数:"
+
JSON
.
stringify
(
body
)
+
"返回结果:"
+
JSON
.
stringify
(
res
),
clientIp
:
""
});
//更新isPushed字段为1
await
this
.
trademarkS
.
updateIsPushed
(
d
.
id
);
...
...
@@ -72,21 +76,16 @@ class TmInfoPusherApi {
return
{
code
:
200
,
message
:
"调用推送接口成功"
};
}
catch
(
e
)
{
console
.
log
(
'collectInfo error: '
,
e
);
//将错误写入到日志
await
this
.
oplogSve
.
create
({
logLevel
:
"error"
,
optitle
:
"推送商标数据至蜂擎---异常"
,
op
:
"app/base/api/impl/tmInfoPusherApi.js/collectInfo"
,
content
:
JSON
.
stringify
(
e
.
stack
),
clientIp
:
""
});
return
e
;
}
}
async
reqPost
(
options
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
request
(
options
,
(
e
,
response
,
body
)
=>
{
if
(
e
)
{
console
.
log
(
'请求igirl接口错误:'
,
e
);
reject
(
e
);
}
return
resolve
(
body
);
});
})
}
}
...
...
fqboss/app/base/service/impl/tmflowSve.js
View file @
49e74a45
...
...
@@ -365,9 +365,11 @@ class TmFlowService extends ServiceBase {
};
if
(
tm
.
tmStatus
!=
officialType
)
{
var
param
=
{
tmStatus
:
officialType
};
param
.
isPushed
=
0
;
//tm状态更新
self
.
trademarkDao
.
updateByWhere
(
param
,
{
where
:
{
tmRegistNum
:
reg_code
}
},
t
);
}
if
(
flowCount
>
0
)
{
params
.
isPushed
=
0
;
//官文信息更新的时候tm状态也会更新
self
.
updateByWhere
(
params
,
flowWhere
,
t
);
}
else
{
opResult
.
isMobileMsg
=
1
;
...
...
fqboss/app/base/utils/aliyunClient.js
View file @
49e74a45
...
...
@@ -3,7 +3,11 @@ const Client = require('aliyun-api-gateway').Client;
const
client
=
new
Client
(
'203732072'
,
'3r0dn583041bco48lq0xgsw09r0hh6ew'
);
const
clientig
=
new
Client
(
'203756805'
,
'crkyej0xlmqa6bmvqijun6ltxparllyn'
);
//开发
<<<<<<<
HEAD
//const clientig = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');//线上
=======
// const clientig = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');//线上
>>>>>>>
facd501a97803626a8b7c6f760b33af2544fcc4c
class
aliyunClient
{
constructor
()
{
this
.
aliReqUrl
=
"https://aliapi.gongsibao.com/tm/springboard"
;
...
...
fqboss/app/config/localsettings.js
View file @
49e74a45
...
...
@@ -6,7 +6,7 @@ var settings = {
db
:
11
,
},
database
:
{
dbname
:
"fqboss"
,
dbname
:
"fqboss
2
"
,
user
:
"write"
,
password
:
"write"
,
// user: "root",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment