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
9eb7c083
Commit
9eb7c083
authored
Sep 03, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
643fba61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
38 deletions
+38
-38
igirl-zcapi/app/base/api/impl/tool/toolApi.js
+38
-38
No files found.
igirl-zcapi/app/base/api/impl/tool/toolApi.js
View file @
9eb7c083
...
...
@@ -19,9 +19,9 @@ class ToolApi extends ApiBase {
this
.
cacheManager
=
System
.
getObject
(
"db.common.cacheManager"
);
this
.
appKeyStr
=
"wx76a324c5d201d1a4"
;
this
.
mailClient
=
System
.
getObject
(
"util.mailClient"
);
this
.
redisClient
=
System
.
getObject
(
"util.redisClient"
);
this
.
redisClient
=
System
.
getObject
(
"util.redisClient"
);
}
async
getUidStr
(
len
,
radix
)
{
async
getUidStr
(
len
,
radix
)
{
var
chars
=
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
.
split
(
''
);
var
uuid
=
[],
i
;
radix
=
radix
||
chars
.
length
;
...
...
@@ -122,7 +122,7 @@ class ToolApi extends ApiBase {
return
{
path
:
'/tmp/'
+
fileName
+
'.xlsx'
,
name
:
fileName
+
'.xlsx'
};
}
//智能分析 bycquerytm.html
async
bycznfx
(
pobj
,
obj
,
req
)
{
async
bycznfx
(
pobj
,
obj
,
req
)
{
var
url
=
obj
.
url
;
if
(
!
url
)
{
return
{
code
:
-
1
,
mag
:
"文件地址为空"
}
...
...
@@ -142,9 +142,9 @@ class ToolApi extends ApiBase {
});
console
.
log
(
r
.
url
);
// return { code: 1, data: r };
if
(
r
.
url
)
{
return
System
.
getResultSuccess
(
r
.
url
,
null
);
}
else
{
if
(
r
.
url
)
{
return
System
.
getResultSuccess
(
r
.
url
,
null
);
}
else
{
return
System
.
getResultFail
(
-
199
,
"计算通过率失败"
);
}
}
else
{
...
...
@@ -156,7 +156,7 @@ class ToolApi extends ApiBase {
}
}
//文字转图片
async
word2pic
(
pobj
,
o
,
req
)
{
async
word2pic
(
pobj
,
o
,
req
)
{
// var app = req.session.app;
var
fs
=
180
;
if
(
o
.
word
&&
o
.
word
.
length
>
1
)
{
...
...
@@ -180,7 +180,7 @@ class ToolApi extends ApiBase {
}
}
//图片彩色转黑白
async
toblack
(
o
,
req
)
{
async
toblack
(
query
,
o
,
req
)
{
var
app
=
req
.
session
.
app
;
var
obj
=
{
"appKey"
:
this
.
appKeyStr
,
...
...
@@ -199,7 +199,7 @@ class ToolApi extends ApiBase {
}
}
//调整商标图样宽高
async
adjustTMSize
(
o
,
req
)
{
async
adjustTMSize
(
query
,
o
,
req
)
{
var
app
=
req
.
session
.
app
;
var
obj
=
{
"appKey"
:
this
.
appKeyStr
,
...
...
@@ -218,7 +218,7 @@ class ToolApi extends ApiBase {
}
}
//创建委托书
async
createWTS
(
o
,
req
)
{
async
createWTS
(
query
,
o
,
req
)
{
// var app = req.session.app;
var
obj
=
{
"appKey"
:
this
.
appKeyStr
,
...
...
@@ -228,7 +228,7 @@ class ToolApi extends ApiBase {
return
result
;
}
//营业执照、身份证明图片转pdf
async
pic2pdf
(
pobj
,
o
,
req
)
{
async
pic2pdf
(
pobj
,
o
,
req
)
{
// var app = req.session.app;
var
obj
=
{
"appKey"
:
this
.
appKeyStr
,
...
...
@@ -248,7 +248,7 @@ class ToolApi extends ApiBase {
}
}
//调整委托书大小
async
adjustWTSSize
(
pobj
,
o
,
req
)
{
async
adjustWTSSize
(
pobj
,
o
,
req
)
{
// var app = req.session.app;
var
obj
=
{
"appKey"
:
this
.
appKeyStr
,
...
...
@@ -267,7 +267,7 @@ class ToolApi extends ApiBase {
}
}
//通过名字查询尼斯信息
async
getNclByLikeName
(
o
,
req
)
{
async
getNclByLikeName
(
query
,
o
,
req
)
{
var
obj
=
{
"name"
:
o
.
name
,
"appKey"
:
this
.
appKeyStr
...
...
@@ -276,7 +276,7 @@ class ToolApi extends ApiBase {
return
result
;
}
async
getNcl
(
o
,
queryobj
,
req
)
{
async
getNcl
(
o
,
queryobj
,
req
)
{
var
that
=
this
;
var
appkey
=
this
.
appKeyStr
;
var
result
=
{
rows
:
[],
count
:
0
};
...
...
@@ -317,7 +317,7 @@ class ToolApi extends ApiBase {
}
return
System
.
getResult2
(
result
,
null
);
}
async
getCompanyInfoByLikeName
(
oo
,
o
,
req
)
{
async
getCompanyInfoByLikeName
(
query
,
o
,
req
)
{
var
appkey
=
this
.
appKeyStr
;
var
data
=
{
appKey
:
appkey
,
...
...
@@ -333,7 +333,7 @@ class ToolApi extends ApiBase {
}
}
async
getEntregistryByCompanyName
(
pobj
,
o
,
req
)
{
async
getEntregistryByCompanyName
(
pobj
,
o
,
req
)
{
var
appkey
=
this
.
appKeyStr
;
var
data
=
{
appKey
:
appkey
,
...
...
@@ -350,7 +350,7 @@ class ToolApi extends ApiBase {
}
//数据中心工商模糊查询接口
async
getCompanyListByVague
(
pobj
,
o
,
req
)
{
async
getCompanyListByVague
(
query
,
pobj
,
req
)
{
var
appkey
=
this
.
appKeyStr
;
var
pageSize
=
pobj
.
pageSize
?
pobj
.
pageSize
:
20
;
var
currentPage
=
pobj
.
currentPage
?
pobj
.
currentPage
:
1
;
...
...
@@ -369,7 +369,7 @@ class ToolApi extends ApiBase {
}
//公司详情信息
async
getDetailByCompanyName
(
pobj
,
o
,
req
)
{
async
getDetailByCompanyName
(
query
,
pobj
,
req
)
{
var
appkey
=
this
.
appKeyStr
;
var
data
=
{
appKey
:
appkey
,
...
...
@@ -384,7 +384,7 @@ class ToolApi extends ApiBase {
}
//企业变更记录查询
async
getCompanyChangeByName
(
pobj
,
o
,
req
)
{
async
getCompanyChangeByName
(
query
,
pobj
,
req
)
{
var
appkey
=
this
.
appKeyStr
;
var
pageSize
=
pobj
.
pageSize
?
o
.
pageSize
:
20
;
var
currentPage
=
pobj
.
currentPage
?
pobj
.
currentPage
:
1
;
...
...
@@ -402,7 +402,7 @@ class ToolApi extends ApiBase {
}
}
//企业ICP证照数据
async
getCompanyIcpByName
(
pobj
,
o
,
req
)
{
async
getCompanyIcpByName
(
query
,
pobj
,
req
)
{
var
appkey
=
this
.
appKeyStr
;
var
pageSize
=
pobj
.
pageSize
?
pobj
.
pageSize
:
20
;
var
currentPage
=
pobj
.
currentPage
?
pobj
.
currentPage
:
1
;
...
...
@@ -420,7 +420,7 @@ class ToolApi extends ApiBase {
}
}
//商标尼斯小项查询过滤
async
getTmNclFilterSearch
(
pobj
,
o
,
req
)
{
async
getTmNclFilterSearch
(
query
,
pobj
,
req
)
{
var
appkey
=
this
.
appKeyStr
;
var
data
=
{
appKey
:
appkey
,
...
...
@@ -456,7 +456,7 @@ class ToolApi extends ApiBase {
fs
.
unlink
(
filePath
,
e
=>
{
console
.
log
(
"fail"
);
});
return
System
.
getResultSuccess
(
result
.
url
,
null
);
return
System
.
getResultSuccess
(
result
.
url
,
null
);
}
else
{
return
System
.
getResultFail
(
-
100
,
"获取图片地址失败"
);
...
...
@@ -468,7 +468,7 @@ class ToolApi extends ApiBase {
}
}
//标准商标图样上传(生成黑白商标,调整商标宽高 使其合规)
async
uploadStandardTm
(
pobj
,
o
,
req
)
{
async
uploadStandardTm
(
pobj
,
o
,
req
)
{
// var app = req.session.app;
var
obj
=
{
"appKey"
:
this
.
appKeyStr
,
...
...
@@ -483,7 +483,7 @@ class ToolApi extends ApiBase {
var
j
=
await
this
.
imghandleApi
.
uploadStandardTm
(
obj
);
return
j
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"uploadStandardTm..........................."
);
console
.
log
(
e
.
stack
,
"uploadStandardTm..........................."
);
return
System
.
getResult2
(
null
,
null
);
}
}
...
...
@@ -502,34 +502,34 @@ class ToolApi extends ApiBase {
}
//生成企业监控报告
async
createMonitoringReport
(
obj
){
async
createMonitoringReport
(
obj
)
{
var
mycompanyname
=
obj
.
companyname
;
var
email
=
obj
.
email
;
if
(
!
mycompanyname
)
{
return
{
code
:
-
1
,
msg
:
"企业名称参数错误"
};
if
(
!
mycompanyname
)
{
return
{
code
:
-
1
,
msg
:
"企业名称参数错误"
};
}
mycompanyname
=
await
this
.
getConvertSemiangleStr
(
mycompanyname
);
if
(
!
email
)
{
return
{
code
:
-
2
,
msg
:
"邮箱参数错误"
};
mycompanyname
=
await
this
.
getConvertSemiangleStr
(
mycompanyname
);
if
(
!
email
)
{
return
{
code
:
-
2
,
msg
:
"邮箱参数错误"
};
}
var
url
=
"http://43.247.184.92:8015/tmdoc/api/createdoc?mycompanyname="
+
encodeURIComponent
(
mycompanyname
);
var
url
=
"http://43.247.184.92:8015/tmdoc/api/createdoc?mycompanyname="
+
encodeURIComponent
(
mycompanyname
);
var
rc
=
System
.
getObject
(
"util.execClient"
);
var
rtn
=
null
;
try
{
rc
.
execGet
({},
url
).
then
(
rtn
=>
{
rc
.
execGet
({},
url
).
then
(
rtn
=>
{
var
j
=
rtn
.
stdout
;
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>'
if
(
j
.
indexOf
(
"gsb-zc.oss-cn-beijing.aliyuncs.com"
)
>=
0
)
{
var
text
=
"企业监控报告"
;
var
html
=
'<a href="'
+
j
+
'">企业监控报告</a>'
var
result
=
this
.
mailClient
.
sendMsg
(
email
,
"企业监控报告"
,
null
,
html
,
null
,
null
,
[]);
//发送成功后result的值:250 Data Ok: queued as freedom
}
})
return
{
code
:
1
};
return
{
code
:
1
};
}
catch
(
e
)
{
console
.
log
(
e
);
return
{
code
:
-
200
,
msg
:
"操作失败"
};
return
{
code
:
-
200
,
msg
:
"操作失败"
};
}
}
...
...
@@ -546,7 +546,7 @@ class ToolApi extends ApiBase {
}
return
result
;
}
async
getOssConfig
(){
async
getOssConfig
()
{
return
this
.
uploadApi
.
getOssConfig
();
}
}
...
...
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