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
c5176b55
Commit
c5176b55
authored
Sep 08, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-channel' of
http://gitlab.gongsibao.com/jiangyong/zhichan
into center-channel
parents
2494fd36
74cb3d2e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
4 deletions
+74
-4
center-channel/app/base/api/impl/auth/taskapi.js
+6
-0
center-channel/app/base/service/impl/utilsSve/utilsTmOrderCallSve.js
+43
-2
center-channel/app/base/utils/aliyunClient.js
+16
-1
center-channel/app/config/localsettings.js
+1
-1
center-channel/app/config/settings.js
+8
-0
No files found.
center-channel/app/base/api/impl/auth/taskapi.js
View file @
c5176b55
...
@@ -9,6 +9,7 @@ class AccessAuthAPI extends APIBase {
...
@@ -9,6 +9,7 @@ class AccessAuthAPI extends APIBase {
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
this
.
utilsTmOrderCallService
=
system
.
getObject
(
"service.utilsSve.utilsTmOrderCallSve"
);
}
}
async
taskAliIcapi
()
{
async
taskAliIcapi
()
{
var
rtn
=
await
this
.
gatewaypushlogSve
.
taskAliIcapi
();
var
rtn
=
await
this
.
gatewaypushlogSve
.
taskAliIcapi
();
...
@@ -34,6 +35,11 @@ class AccessAuthAPI extends APIBase {
...
@@ -34,6 +35,11 @@ class AccessAuthAPI extends APIBase {
return
rtn
;
return
rtn
;
}
}
async
taskAlijsonfile
(
pobj
,
qobj
,
req
)
{
//操作阿里商标交易上架
var
rtn
=
await
this
.
utilsTmOrderCallService
.
createjsonfile
();
return
rtn
;
}
async
taskAliRpcAgainPush
(
pobj
,
qobj
,
req
)
{
async
taskAliRpcAgainPush
(
pobj
,
qobj
,
req
)
{
var
result
=
await
this
.
pushlogSve
.
getFailLogList
();
var
result
=
await
this
.
pushlogSve
.
getFailLogList
();
if
(
result
.
status
!=
0
||
!
result
.
data
||
result
.
data
.
length
==
0
)
{
if
(
result
.
status
!=
0
||
!
result
.
data
||
result
.
data
.
length
==
0
)
{
...
...
center-channel/app/base/service/impl/utilsSve/utilsTmOrderCallSve.js
View file @
c5176b55
...
@@ -4,7 +4,7 @@ const querystring = require('querystring');
...
@@ -4,7 +4,7 @@ const querystring = require('querystring');
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
{
or
}
=
require
(
"sequelize"
);
const
{
or
}
=
require
(
"sequelize"
);
//订单操作类
//订单操作类
class
Utils
OpOrder
Service
extends
AppServiceBase
{
class
Utils
TmOrderCall
Service
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
...
@@ -23,5 +23,46 @@ class UtilsOpOrderService extends AppServiceBase {
...
@@ -23,5 +23,46 @@ class UtilsOpOrderService extends AppServiceBase {
console
.
log
(
"orderList"
,
orderList
)
console
.
log
(
"orderList"
,
orderList
)
return
system
.
getResultSuccess
(
orderList
);
return
system
.
getResultSuccess
(
orderList
);
}
}
async
createjsonfile
()
{
var
self
=
this
;;
var
gobj
=
{
action
:
"GenerateUploadFilePolicy"
,
reqbody
:
{
FileType
:
"PARTNER_SYNC_FILE"
},
type
:
'TM'
}
var
rst
=
await
self
.
aliclient
.
reqbyget
(
gobj
);
console
.
log
(
rst
);
var
obj
=
{
actionType
:
"createjsonfile"
,
actionBody
:{}
}
var
getjsonurl
=
settings
.
tmtransactionUrl
()
+
"/api/action/trademarktransaction"
var
jsonurl
=
await
this
.
restPostUrl
(
obj
,
getjsonurl
);
if
(
!
jsonurl
){
console
.
log
(
jsonurl
);
return
system
.
getResultSuccess
();
}
var
upobj
=
{
ossurl
:
jsonurl
.
data
.
url
,
filedir
:
rst
.
data
.
FileDir
,
objectName
:
jsonurl
.
data
.
name
,
encodePolicy
:
rst
.
data
.
EncodedPolicy
,
endpoint
:
"http://partner-sync-file.oss-cn-beijing.aliyuncs.com"
,
accessKeyId
:
rst
.
data
.
AccessId
,
bucketName
:
"partner-sync-file"
}
var
aliOssFileInfo
=
await
this
.
execPostUrl
(
upobj
,
settings
.
aliossjavaUrl
());
if
(
aliOssFileInfo
==
true
)
{
var
fileUrl
=
rst
.
data
.
FileDir
+
"/"
+
jsonurl
.
data
.
name
;
console
.
log
(
fileUrl
)
return
system
.
getResultSuccess
(
fileUrl
);
}
}
}
}
module
.
exports
=
UtilsOpOrderService
;
module
.
exports
=
UtilsTmOrderCallService
;
// var a=new UtilsTmOrderCallService();
// a.createjsonfile();
center-channel/app/base/utils/aliyunClient.js
View file @
c5176b55
...
@@ -14,6 +14,15 @@ class aliyunClient {
...
@@ -14,6 +14,15 @@ class aliyunClient {
apiVersion
:
"2020-03-06"
apiVersion
:
"2020-03-06"
});
});
}
}
getAliTMClient
()
{
return
new
RPCClient
({
accessKeyId
:
'LTAI4FmyipY1wuLHjLhMWiPa'
,
accessKeySecret
:
'hp4FF18IDCSym1prqzxrAjnnhNH3ju'
,
endpoint
:
'https://trademark.aliyuncs.com'
,
apiVersion
:
'2018-07-24'
}
);
}
async
post
(
aliReqUrl
,
key
,
secret
,
actionBody
)
{
async
post
(
aliReqUrl
,
key
,
secret
,
actionBody
)
{
const
client
=
new
Client
(
key
,
secret
);
const
client
=
new
Client
(
key
,
secret
);
var
param
=
{
var
param
=
{
...
@@ -32,8 +41,14 @@ class aliyunClient {
...
@@ -32,8 +41,14 @@ class aliyunClient {
async
reqbyget
(
obj
,
cbk
)
{
async
reqbyget
(
obj
,
cbk
)
{
var
action
=
obj
.
action
;
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
var
reqbody
=
obj
.
reqbody
;
var
self
=
this
;
try
{
try
{
var
reqAliclient
=
this
.
getAliClient
();
// { ... this.aliclient };
var
reqAliclient
=
null
;
// { ... this.aliclient };
if
(
obj
.
type
&&
obj
.
type
==
"TM"
){
reqAliclient
=
self
.
getAliTMClient
();
}
else
{
reqAliclient
=
self
.
getAliClient
();
}
if
(
obj
.
apiVersion
)
{
if
(
obj
.
apiVersion
)
{
reqAliclient
.
apiVersion
=
obj
.
apiVersion
;
reqAliclient
.
apiVersion
=
obj
.
apiVersion
;
}
}
...
...
center-channel/app/config/localsettings.js
View file @
c5176b55
var
settings
=
{
var
settings
=
{
redis
:
{
redis
:
{
host
:
"
43.247.184.32
"
,
host
:
"
121.36.3.35
"
,
port
:
8967
,
port
:
8967
,
password
:
"Gongsibao2018"
,
password
:
"Gongsibao2018"
,
db
:
5
,
db
:
5
,
...
...
center-channel/app/config/settings.js
View file @
c5176b55
...
@@ -51,6 +51,14 @@ var settings = {
...
@@ -51,6 +51,14 @@ var settings = {
return
"http://aliossjava-service/uploadfile"
;
return
"http://aliossjava-service/uploadfile"
;
}
}
},
},
tmtransactionUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.2.109:8080/uploadfile"
;
}
else
{
return
"http://center-tmtransaction-service"
;
}
},
qifuPayAfterH5JumpUrl
:
function
()
{
qifuPayAfterH5JumpUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
return
"http://tm.qifu.gongsibao.com:4012/#/home/indent_list"
;
return
"http://tm.qifu.gongsibao.com:4012/#/home/indent_list"
;
...
...
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