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
0e8d8537
Commit
0e8d8537
authored
Mar 03, 2021
by
wangyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: (icbcSve.js) 资质查询接口添加商标查询
parent
d3a84303
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
187 additions
and
116 deletions
+187
-116
center-channel/app/base/service/impl/trademark/icbcSve.js
+137
-116
center-channel/app/base/service/impl/utilsSve/utilsResultSve.js
+50
-0
No files found.
center-channel/app/base/service/impl/trademark/icbcSve.js
View file @
0e8d8537
...
@@ -3,129 +3,149 @@ var settings = require("../../../../config/settings");
...
@@ -3,129 +3,149 @@ var settings = require("../../../../config/settings");
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
class
IcbcService
extends
AppServiceBase
{
class
IcbcService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
zcApiUrl
=
settings
.
reqZcApi
();
this
.
zcApiUrl
=
settings
.
reqZcApi
();
this
.
certificationUrl
=
settings
.
certificationUrl
();
this
.
certificationUrl
=
settings
.
certificationUrl
();
this
.
restClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
restClient
=
system
.
getObject
(
"util.redisClient"
);
//处理企业资质证书数据
//处理企业资质证书数据
this
.
disposeCertificationData
=
"disposeCertificationData"
;
this
.
disposeCertificationData
=
"disposeCertificationData"
;
//企业资质证书查询
//企业资质证书查询
this
.
searchCertificationData
=
"searchCertificationData"
;
this
.
searchCertificationData
=
"searchCertificationData"
;
}
//result工具类
//企业模糊查询
this
.
utilsResultSve
=
system
.
getObject
(
"service.utilsSve.utilsResultSve"
);
async
getCompanyListByVague
(
obj
,
req
)
{
}
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getCompanyListByVague"
;
//企业模糊查询
return
await
this
.
opReqResult
(
url
,
obj
,
req
);
async
getCompanyListByVague
(
obj
,
req
)
{
}
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getCompanyListByVague"
;
//企业详情
return
await
this
.
opReqResult
(
url
,
obj
,
req
);
async
getDetailByCompanyName
(
queryobj
,
req
)
{
}
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getDetailByCompanyName"
;
//企业详情
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
async
getDetailByCompanyName
(
queryobj
,
req
)
{
}
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getDetailByCompanyName"
;
//企业变更记录查询
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
async
getCompanyChangeByName
(
queryobj
,
req
)
{
}
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getCompanyChangeByName"
;
//企业变更记录查询
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
async
getCompanyChangeByName
(
queryobj
,
req
)
{
}
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getCompanyChangeByName"
;
//工商icp证照查询
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
async
getCompanyIcpByName
(
queryobj
,
req
)
{
}
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getCompanyIcpByName"
;
//工商icp证照查询
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
async
getCompanyIcpByName
(
queryobj
,
req
)
{
}
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getCompanyIcpByName"
;
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
}
//企业证书查询
//企业证书查询
// async searchCertification(queryobj, req) {
// async searchCertification(queryobj, req) {
// if (!queryobj.companyName) {
// if (!queryobj.companyName) {
// return system.getResultFail(-1, 'companyName can not be empty');
// return system.getResultFail(-1, 'companyName can not be empty');
// }
// }
// var hashValue = await this.restClient.hget(this.searchCertificationData, queryobj.companyName);
// var hashValue = await this.restClient.hget(this.searchCertificationData, queryobj.companyName);
// if (hashValue) {
// if (hashValue) {
// return system.getResultSuccess(JSON.parse(hashValue));
// return system.getResultSuccess(JSON.parse(hashValue));
// }
// }
// let url = this.certificationUrl + "gsb/SearchCertification";
// let url = this.certificationUrl + "gsb/SearchCertification";
// let data = {
// let data = {
// "company_name": queryobj.companyName,
// "company_name": queryobj.companyName,
// "pageSize": 20,
// "pageSize": 20,
// "pageIndex": 1,
// "pageIndex": 1,
// "isExactlySame": "True"
// "isExactlySame": "True"
// }
// }
// let result = await this.opReqResult(url, data, req);
// let result = await this.opReqResult(url, data, req);
// if (!result) {
// if (!result) {
// return system.getResultFail(-1, '查询失败!!!');
// return system.getResultFail(-1, '查询失败!!!');
// }
// }
// if (result.Status != 200) {
// if (result.Status != 200) {
// return system.getResultFail(-1, '查询失败');
// return system.getResultFail(-1, '查询失败');
// }
// }
// //对结果处理
// //对结果处理
// // "Tag": 1为qichacha,0为gsb
// // "Tag": 1为qichacha,0为gsb
// var setValue = {};
// var setValue = {};
// setValue[queryobj.companyName] = JSON.stringify(result.Result);
// setValue[queryobj.companyName] = JSON.stringify(result.Result);
// if (result.Tag == 1) {
// if (result.Tag == 1) {
// this.restClient.hmset(this.disposeCertificationData, setValue);
// this.restClient.hmset(this.disposeCertificationData, setValue);
// }
// }
// this.restClient.hmset(this.searchCertificationData, setValue);
// this.restClient.hmset(this.searchCertificationData, setValue);
// return system.getResult(result.Result);
// return system.getResult(result.Result);
// }
// }
//企业证书查询 用友数据源
//企业证书查询 用友数据源
async
searchCertification
(
queryobj
,
req
)
{
async
searchCertification
(
queryobj
,
req
)
{
if
(
!
queryobj
.
companyName
)
{
if
(
!
queryobj
.
companyName
)
{
return
system
.
getResultFail
(
-
1
,
'companyName can not be empty'
);
return
system
.
getResultFail
(
-
1
,
'companyName can not be empty'
);
}
}
var
hashValue
=
await
this
.
restClient
.
hget
(
this
.
searchCertificationData
,
queryobj
.
companyName
);
var
hashValue
=
await
this
.
restClient
.
hget
(
this
.
searchCertificationData
,
queryobj
.
companyName
);
if
(
hashValue
)
{
if
(
hashValue
)
{
return
system
.
getResultSuccess
(
JSON
.
parse
(
hashValue
));
return
system
.
getResultSuccess
(
JSON
.
parse
(
hashValue
));
}
}
//获取token
//获取token
let
url
=
settings
.
icNameUrl
()
+
'openPlatform/platform/getToken'
;
let
url
=
settings
.
icNameUrl
()
+
'openPlatform/platform/getToken'
;
let
params
=
{
let
params
=
{
"accessKey"
:
"111"
,
"accessKey"
:
"111"
,
"accessSecret"
:
"222"
"accessSecret"
:
"222"
}
}
let
ret
=
await
this
.
opReqResult
(
url
,
params
,
req
);
let
ret
=
await
this
.
opReqResult
(
url
,
params
,
req
);
if
(
ret
.
status
!=
1
)
{
if
(
ret
.
status
!=
1
)
{
system
.
getResultFail
(
-
1
,
'获取开放平台token失败'
);
system
.
getResultFail
(
-
1
,
'获取开放平台token失败'
);
}
}
let
token
=
ret
.
data
;
let
token
=
ret
.
data
;
url
=
settings
.
icNameUrl
()
+
"openPlatform/busenterprise/cloudapi"
;
url
=
settings
.
icNameUrl
()
+
"openPlatform/busenterprise/cloudapi"
;
let
data
=
{
let
tmUrl
=
settings
.
icNameUrl
()
+
"openPlatform/busservices/cloudApi"
"path"
:
"/apis/dst/patents/certificate"
,
//资质查询
"name"
:
queryobj
.
companyName
let
data
=
{
}
"path"
:
"/apis/dst/patents/certificate"
,
let
rtn
=
await
this
.
execClient
.
restGetWithHAuthorizationUrl
(
token
,
url
,
data
);
"name"
:
queryobj
.
companyName
if
(
!
rtn
||
!
rtn
.
stdout
)
{
};
return
system
.
getResult
(
null
,
"restPostWithHAuthorizationUrl data is empty"
);
//商标查询
}
let
tmData
=
{
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
"path"
:
"getTrademarkInfo"
,
if
(
!
result
)
{
"entName"
:
queryobj
.
companyName
,
return
system
.
getResultFail
(
-
1
,
'查询失败!!!'
);
"pageNo"
:
1
,
//页码
}
"pageSize"
:
10
//每页显示最大数量,最大100
if
(
result
.
error_code
!=
0
)
{
};
return
system
.
getResultFail
(
-
1
,
'查询失败'
);
let
rtn
=
await
this
.
execClient
.
restGetWithHAuthorizationUrl
(
token
,
url
,
data
);
let
tmrtn
=
await
this
.
execClient
.
restGetWithHAuthorizationUrl
(
token
,
tmUrl
,
tmData
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"restPostWithHAuthorizationUrl data is empty"
);
};
let
tmArray
=
[];
if
(
tmrtn
.
status
==
1
&&
tmrtn
.
data
)
{
var
tmResult
=
JSON
.
parse
(
tmrtn
.
data
);
tmArray
=
this
.
utilsResultSve
.
formulaContinued
(
tmResult
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
!
result
)
{
return
system
.
getResultFail
(
-
1
,
'查询失败!!!'
);
}
if
(
result
.
error_code
!=
0
)
{
return
system
.
getResultFail
(
-
1
,
'查询失败'
);
}
let
item
=
result
.
result
.
items
;
//对结果处理
// "Tag": 1为qichacha,0为gsb
var
setValue
=
{};
setValue
[
queryobj
.
companyName
]
=
JSON
.
stringify
(
item
);
setValue
[
tm
]
=
JSON
.
stringify
(
tmArray
);
// if (result.Tag == 1) {
// this.restClient.hmset(this.disposeCertificationData, setValue);
// }
this
.
restClient
.
hmset
(
this
.
searchCertificationData
,
setValue
);
return
system
.
getResult
(
item
);
}
}
let
item
=
result
.
result
.
items
;
//对结果处理
// "Tag": 1为qichacha,0为gsb
var
setValue
=
{};
setValue
[
queryobj
.
companyName
]
=
JSON
.
stringify
(
item
);
// if (result.Tag == 1) {
// this.restClient.hmset(this.disposeCertificationData, setValue);
// }
this
.
restClient
.
hmset
(
this
.
searchCertificationData
,
setValue
);
return
system
.
getResult
(
item
);
}
async
opReqResult
(
reqUrl
,
queryobj
,
req
)
{
async
opReqResult
(
reqUrl
,
queryobj
,
req
)
{
var
rtn
=
await
this
.
execClient
.
execPushDataPost
(
queryobj
,
reqUrl
,
req
.
headers
[
"token"
],
req
.
headers
[
"request-id"
]);
var
rtn
=
await
this
.
execClient
.
execPushDataPost
(
queryobj
,
reqUrl
,
req
.
headers
[
"token"
],
req
.
headers
[
"request-id"
]);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
return
data
;
}
}
}
}
module
.
exports
=
IcbcService
;
module
.
exports
=
IcbcService
;
\ No newline at end of file
center-channel/app/base/service/impl/utilsSve/utilsResultSve.js
0 → 100644
View file @
0e8d8537
var
system
=
require
(
"../../../system"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//外部请求结果校验以及相应工具处理类
class
utilsTlBankSve
extends
AppServiceBase
{
constructor
()
{
super
();
}
//格式化时间
convertDate
(
time
)
{
if
(
time
==
null
)
{
return
""
;
}
var
date
=
new
Date
(
Number
(
time
*
1000
));
var
y
=
1900
+
date
.
getYear
();
var
m
=
"0"
+
(
date
.
getMonth
()
+
1
);
var
d
=
"0"
+
date
.
getDate
();
return
y
+
"-"
+
m
.
substring
(
m
.
length
-
2
,
m
.
length
)
+
"-"
+
d
.
substring
(
d
.
length
-
2
,
d
.
length
);
}
//计算并返回指定字段
formulaContinued
(
tms
)
{
let
result
=
[];
for
(
let
i
=
0
;
i
<
tms
.
length
;
i
++
)
{
let
tmInfo
=
tms
[
i
];
if
(
!
tmInfo
.
REGDATE
)
{
//注册公告日期
continue
;
}
let
zcrqFormat
=
new
Date
(
tmInfo
.
REGDATE
*
1000
);
//注册日期
zcrqFormat
.
setFullYear
(
zcrqFormat
.
getFullYear
()
+
10
);
//专用起始日期计算
zcrqFormat
.
setMonth
(
zcrqFormat
.
getMonth
());
//专用起始日期计算
zcrqFormat
.
setDate
(
zcrqFormat
.
getDate
());
//专用起始日期计算
let
tmObject
=
{
"tm_comName"
:
tmInfo
.
AGENTNAME
,
//代理机构
"tm_img"
:
tmInfo
.
MARKIMAGE
,
//商标图片
"tm_name"
:
tmInfo
.
MARKNAME
,
//商标名称
"tm_appDate"
:
tmInfo
.
APPDATE
,
//申请日期
"tm_isInvalid"
:
tmInfo
.
ISINVALID
,
//状态
"tm_expiry"
:
this
.
convertDate
(
zcrqFormat
)
//商标到期日
}
result
.
push
(
tmObject
);
}
return
result
;
}
}
module
.
exports
=
utilsTlBankSve
;
\ No newline at end of file
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