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
0a38ebd3
Commit
0a38ebd3
authored
May 09, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
7e424a00
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
13 deletions
+148
-13
center-channel/app/base/api/impl/action/tmQuery.js
+3
-0
center-channel/app/base/service/impl/trademark/tmquerySve.js
+10
-1
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
+91
-10
center-channel/app/base/utils/ossClient.js
+4
-2
center-channel/app/config/settings.js
+8
-0
center-channel/app/front/entry/public/apidoc/opTrademark/tmSearch.md
+32
-0
No files found.
center-channel/app/base/api/impl/action/tmQuery.js
View file @
0a38ebd3
...
...
@@ -91,6 +91,9 @@ class TmQueryAPI extends WEBBase {
case
"icheming"
:
//商标智能分析 -----
opResult
=
await
this
.
toolSve
.
icheming
(
action_body
,
req
);
break
;
case
"tmreport"
:
//商标报告
opResult
=
await
this
.
tmquerySve
.
tmreport
(
action_body
,
req
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-channel/app/base/service/impl/trademark/tmquerySve.js
View file @
0a38ebd3
...
...
@@ -74,10 +74,19 @@ class TmqueryService {
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
}
async
tmreport
(
queryobj
,
req
){
var
url
=
settings
.
igirlWeburl
()
+
"web/toolCtl/createMonitoringReportH5p"
;
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
}
async
opReqResult
(
reqUrl
,
queryobj
,
req
)
{
var
rtn
=
await
this
.
execClient
.
execPushDataPost
(
queryobj
,
reqUrl
,
req
.
headers
[
"token"
],
req
.
headers
[
"request-id"
]);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
if
(
data
.
code
>
0
){
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResultFail
();
}
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
0a38ebd3
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
fs
=
require
(
"fs"
);
//需求操作类
class
UtilsNeedService
extends
AppServiceBase
{
constructor
()
{
...
...
@@ -9,6 +10,7 @@ class UtilsNeedService extends AppServiceBase {
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
ossClient
=
system
.
getObject
(
"util.ossClient"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
}
/**
...
...
@@ -39,7 +41,16 @@ class UtilsNeedService extends AppServiceBase {
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedBusiness"
);
if
(
pobj
.
actionBody
.
channel_type_code
==
"esp.companyreg"
){
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedBusiness"
);
}
else
{
if
(
pobj
.
actionBody
.
channel_type_code
==
5
){
pobj
.
actionBody
.
regType
=
"ali.icp"
;
}
else
{
pobj
.
actionBody
.
regType
=
"ali.edi"
;
}
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"intention"
);
}
}
return
result
;
}
...
...
@@ -50,7 +61,7 @@ class UtilsNeedService extends AppServiceBase {
if
(
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
pobj
.
actionType
=
"
abolishIcpProgramme
"
;
pobj
.
actionType
=
"
receiveIcpFeedback
"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
...
...
@@ -142,36 +153,37 @@ class UtilsNeedService extends AppServiceBase {
if
(
!
actionBody
.
bizId
)
{
return
system
.
getResult
(
null
,
"actionBody.bizId can not be empty,100495"
);
}
actionBody
.
BizId
=
actionBody
.
bizId
;
if
(
!
actionBody
.
status
)
{
return
system
.
getResult
(
null
,
"actionBody.status can not be empty,100495"
);
}
if
(
actionBody
.
businessLicense
)
{
actionBody
.
newbusinessLicense
=
await
self
.
o
ssClient
.
aliurl2zcurl
(
actionBody
.
businessLicense
);
actionBody
.
newbusinessLicense
=
await
self
.
o
pDownFileInfo
(
actionBody
.
businessLicense
);
}
if
(
actionBody
.
idCardUrlList
)
{
var
jsonidCardUrlList
=
JSON
.
stringify
(
actionBody
.
idCardUrlList
);
var
jsonidCardUrlList
=
JSON
.
parse
(
actionBody
.
idCardUrlList
);
var
newidCardUrlList
=
[];
for
(
var
i
=
0
;
i
<
jsonidCardUrlList
.
length
;
i
++
)
{
var
key
=
jsonidCardUrlList
[
i
];
newidCardUrlList
.
push
(
await
self
.
o
ssClient
.
aliurl2zcurl
(
key
));
newidCardUrlList
.
push
(
await
self
.
o
pDownFileInfo
(
key
));
}
actionBody
.
newidCardUrlList
=
newidCardUrlList
;
}
if
(
actionBody
.
userPlan
)
{
actionBody
.
newuserPlan
=
await
self
.
o
ssClient
.
aliurl2zcurl
(
actionBody
.
userPlan
);
actionBody
.
newuserPlan
=
await
self
.
o
pDownFileInfo
(
actionBody
.
userPlan
);
}
if
(
actionBody
.
userForeig
)
{
actionBody
.
newuserForeig
=
await
self
.
o
ssClient
.
aliurl2zcurl
(
actionBody
.
userForeig
);
actionBody
.
newuserForeig
=
await
self
.
o
pDownFileInfo
(
actionBody
.
userForeig
);
}
if
(
actionBody
.
userLaw
)
{
actionBody
.
newuserLaw
=
await
self
.
o
ssClient
.
aliurl2zcurl
(
actionBody
.
userLaw
);
actionBody
.
newuserLaw
=
await
self
.
o
pDownFileInfo
(
actionBody
.
userLaw
);
}
if
(
actionBody
.
userOtherList
)
{
var
jsonuserOtherList
=
JSON
.
stringify
(
actionBody
.
userOtherList
);
var
jsonuserOtherList
=
JSON
.
parse
(
actionBody
.
userOtherList
);
var
newuserOtherList
=
[];
for
(
var
i
=
0
;
i
<
jsonuserOtherList
.
length
;
i
++
)
{
var
key
=
jsonuserOtherList
[
i
];
newuserOtherList
.
push
(
await
self
.
o
ssClient
.
aliurl2zcurl
(
key
));
newuserOtherList
.
push
(
await
self
.
o
pDownFileInfo
(
key
));
}
actionBody
.
newuserOtherList
=
newuserOtherList
;
}
...
...
@@ -180,7 +192,75 @@ class UtilsNeedService extends AppServiceBase {
var
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
rtn
;
}
async
opDownFileInfo
(
docUrl
,
result
)
{
//从oss下载到本地并上传到自己oss,之后删除本地文件
/*docUrl下载链接,全路径,如:https://XXXXXX.pdf?XXXXX */
try
{
var
tmpFileName
=
docUrl
.
substring
(
0
,
docUrl
.
lastIndexOf
(
"?"
));
var
fileName
=
tmpFileName
.
substr
(
tmpFileName
.
lastIndexOf
(
"/"
)
+
1
,
tmpFileName
.
lenght
);
//解码后的文件全名:xxx.pdf
var
fileAllName
=
decodeURIComponent
(
fileName
);
//为xxx.pdf
var
saveFilePath
=
'/tmp/'
+
fileAllName
;
// 下载文件到指定的路径
var
tmpp
=
await
this
.
restClient
.
execDownload
(
"'"
+
docUrl
+
"'"
,
saveFilePath
);
//上传 saveFilePath的文件 到ossClient
var
rtn
=
await
this
.
ossClient
.
upfile
(
fileAllName
,
saveFilePath
);
result
=
rtn
.
url
;
//删除本地文件
fs
.
unlink
(
saveFilePath
,
function
(
err
)
{
});
}
catch
(
e
)
{
}
return
result
;
}
async
needDetailByChannelNo
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
bizId
)
{
return
system
.
getResult
(
null
,
"actionBody.bizId can not be empty,100491"
);
}
var
solutionobj
=
{
actionType
:
"getIcpProgrammeDetail"
,
actionBody
:
{
BizId
:
pobj
.
actionBody
.
bizId
},
appInfo
:
pobj
.
appInfo
,
actionProcess
:
pobj
.
actionProcess
}
var
url
=
this
.
centerOrderUrl
+
"action/icpapi/springBoard"
;
var
solutionrtn
=
await
this
.
execClient
.
execPost
(
solutionobj
,
url
);
if
(
!
solutionrtn
||
!
solutionrtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5011
,
"方案查询失败"
);
}
var
solutiondata
=
JSON
.
parse
(
solutionrtn
.
stdout
);
if
(
solutiondata
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5011
,
"方案查询失败"
);
}
if
(
solutiondata
.
data
&&
solutiondata
.
data
[
0
].
channelNeedNo
)
{
pobj
.
actionBody
.
needNo
=
solutiondata
.
data
[
0
].
channelNeedNo
;
pobj
.
actionBody
.
needId
=
solutiondata
.
data
[
0
].
channelNeedNo
;
pobj
.
actionBody
.
channelSolutionNo
=
solutiondata
.
data
[
0
].
channelSolutionNo
;
}
var
sobj
=
{
actionType
:
"getItemByChannelNeedNo"
,
actionBody
:
pobj
.
actionBody
,
appInfo
:
pobj
.
appInfo
,
actionProcess
:
pobj
.
actionProcess
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
itemResult
=
await
this
.
restPostUrl
(
sobj
,
reqUrl
);
if
(
itemResult
.
status
==
0
){
itemResult
.
data
.
channelSolutionNo
=
pobj
.
actionBody
.
channelSolutionNo
;
}
return
itemResult
;
}
// async test1() {
// var a = await this.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: "20200416125415000001", Note: "测试需求关闭" }, apiVersion: "2019-05-08" });
// console.log(a.data);
// return a;
// }
}
module
.
exports
=
UtilsNeedService
;
// var a=new UtilsNeedService();
// a.test1();
\ No newline at end of file
center-channel/app/base/utils/ossClient.js
View file @
0a38ebd3
...
...
@@ -39,10 +39,12 @@ class OSSClient {
}
async
aliurl2zcurl
(
key
)
{
var
writeStream
=
fs
.
createWriteStream
(
"/tmp/"
+
key
.
split
(
"/"
).
pop
())
var
filename
=
key
.
split
(
"/"
).
pop
().
split
(
"?"
)[
0
];
var
writeStream
=
fs
.
createWriteStream
(
"/tmp/tmpfile.jpg"
);
var
self
=
this
;
request
(
key
).
pipe
(
writeStream
);
writeStream
.
on
(
'finish'
,
function
()
{
oss
.
upfile
(
"20200412aaa33.jpg"
,
"/tmp/"
+
key
.
split
(
"/"
).
pop
()
).
then
(
function
(
result
)
{
self
.
upfile
(
filename
,
"/tmp/tmpfile.jsp"
).
then
(
function
(
result
)
{
console
.
log
(
result
.
res
.
requestUrls
[
0
]);
return
result
.
res
.
requestUrls
[
0
];
});
...
...
center-channel/app/config/settings.js
View file @
0a38ebd3
...
...
@@ -83,6 +83,14 @@ var settings = {
return
"http://center-order-service/"
;
}
},
igirlWeburl
:
function
(){
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.210.106:3000/"
;
}
else
{
return
"http://igirl-service/"
;
}
},
reqTransferurl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.61:3003/"
;
...
...
center-channel/app/front/entry/public/apidoc/opTrademark/tmSearch.md
View file @
0a38ebd3
...
...
@@ -17,6 +17,7 @@
1.
[
获取尼斯群组
](
#gettwoNcl
)
1.
[
尼斯分类检索
](
#nclFuwuSearch
)
1.
[
商标智能分析
](
#bycznfx
)
1.
[
商标报告
](
#tmreport
)
...
...
@@ -2647,3 +2648,34 @@
```
## **<a name="tmreport"> 商标报告</a>**
[
返回到目录
](
#menu
)
##### URL
[
api/action/tmQuery/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:tmreport
```
javascript
{
"actionType"
:
"tmreport"
,
"actionBody"
:
{
"companyname"
:
""
,
//公司名称
"phonenum"
:
""
,
//电话 非必添
"email"
:
""
,
//邮箱
}
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"3b8c2108ec8743c0a138081c5223f91c"
}
```
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