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
f63e2da2
Commit
f63e2da2
authored
Jan 16, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
6e8a5f53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
5 deletions
+54
-5
igirl-web/app/base/api/impl/tmtransactionApi.js
+54
-5
No files found.
igirl-web/app/base/api/impl/tmtransactionApi.js
View file @
f63e2da2
...
@@ -8,23 +8,25 @@ class TmtransactionApi extends ApiBase {
...
@@ -8,23 +8,25 @@ class TmtransactionApi extends ApiBase {
this
.
trademarktransactionSve
=
System
.
getObject
(
"service.trademarktransactionSve"
);
this
.
trademarktransactionSve
=
System
.
getObject
(
"service.trademarktransactionSve"
);
this
.
companyS
=
System
.
getObject
(
"service.companySve"
);
this
.
companyS
=
System
.
getObject
(
"service.companySve"
);
this
.
utilstmtasktradeSve
=
System
.
getObject
(
"service.utilstmtasktradeSve"
);
this
.
utilstmtasktradeSve
=
System
.
getObject
(
"service.utilstmtasktradeSve"
);
this
.
pytmreportSve
=
System
.
getObject
(
"service.pytmreportSve"
);
this
.
mailClient
=
System
.
getObject
(
"util.mailClient"
);
};
};
//获取某类型的交易商标 post
//获取某类型的交易商标 post
async
findByTmType
(
obj
){
async
findByTmType
(
obj
)
{
if
(
!
obj
.
company_id
)
{
if
(
!
obj
.
company_id
)
{
//获取当前域名
//获取当前域名
var
hostname
=
"jiaoyi.gongsibao.com"
;
var
hostname
=
"jiaoyi.gongsibao.com"
;
// console.log("xccccccccccccccccccccccccccccccccccccccc", hostname);
// console.log("xccccccccccccccccccccccccccccccccccccccc", hostname);
//按照hostname去查找公司站点信息
//按照hostname去查找公司站点信息
var
companytmp
=
await
this
.
companyS
.
findOne
({
domainname
:
hostname
,
isEnabled
:
true
});
var
companytmp
=
await
this
.
companyS
.
findOne
({
domainname
:
hostname
,
isEnabled
:
true
});
if
(
companytmp
)
{
if
(
companytmp
)
{
obj
.
company_id
=
companytmp
.
id
;
obj
.
company_id
=
companytmp
.
id
;
}
}
}
}
try
{
try
{
return
this
.
trademarktransactionSve
.
findByTmType
(
obj
);
return
this
.
trademarktransactionSve
.
findByTmType
(
obj
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
{
code
:
-
200
,
msg
:
"操作失败"
};
return
{
code
:
-
200
,
msg
:
"操作失败"
};
}
}
}
}
...
@@ -44,5 +46,52 @@ class TmtransactionApi extends ApiBase {
...
@@ -44,5 +46,52 @@ class TmtransactionApi extends ApiBase {
console
.
log
(
e
.
stack
,
"ttttttttt..............."
);
console
.
log
(
e
.
stack
,
"ttttttttt..............."
);
}
}
}
}
async
tmreport
()
{
var
id
=
await
this
.
redisClient
.
lpop
(
"create_tmrepotCache"
);
// console.log(id, "商标检索报告执行开始.................");
if
(
id
)
{
var
info
=
await
this
.
pytmreportSve
.
dao
.
findById
(
id
);
console
.
log
(
info
.
dataValues
);
if
(
info
)
{
var
url
=
"http://43.247.184.92:8015/tmdoc/api/createdoc?mycompanyname="
+
encodeURIComponent
(
info
.
companyname
);
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
rtn
=
null
;
try
{
rtn
=
await
rc
.
execGetTimeOut
({},
url
,
300000
);
var
j
=
rtn
.
stdout
;
// var j="https://gsb-zc.oss-cn-beijing.aliyuncs.com/北京创知厚德科技有限公司_20190822014212_tmreport.docx"
// console.log("fanhui");
console
.
log
(
j
);
if
(
j
.
indexOf
(
"gsb-zc.oss-cn-beijing.aliyuncs.com"
)
>=
0
)
{
var
text
=
"企业监控报告"
;
var
html
=
'<a href="'
+
j
+
'">企业监控报告</a>'
var
mresult
=
this
.
mailClient
.
sendMsg
(
info
.
email
,
"企业监控报告"
,
null
,
html
,
null
,
null
,
[]);
//发送成功后result的值:250 Data Ok: queued as freedom
}
info
.
dataValues
.
filepath
=
j
;
info
.
dataValues
.
status
=
1
;
var
result
=
await
this
.
pytmreportSve
.
dao
.
model
.
update
(
info
.
dataValues
,
{
where
:
{
id
:
id
}
});
logCtl
.
info
({
optitle
:
"商标检索报告执行结果"
,
op
:
"/igirl-web/app/base/db/task/CreatetmrepotTask.js"
,
content
:
"id="
+
id
+
"执行结果:"
+
j
,
clientIp
:
""
});
return
result
;
}
catch
(
e
)
{
console
.
log
(
e
);
//日志记录
logCtl
.
error
({
optitle
:
"商标检索报告执行结果-error"
,
op
:
"/igirl-web/app/base/db/task/CreatetmrepotTask.js"
,
content
:
e
.
stack
,
clientIp
:
""
});
return
{
code
:
-
200
,
msg
:
"操作失败"
};
}
}
}
}
}
}
module
.
exports
=
TmtransactionApi
;
module
.
exports
=
TmtransactionApi
;
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