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
fc8a297a
Commit
fc8a297a
authored
Apr 14, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Plain Diff
wdy
parents
1dede7eb
97af5cb9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
1077 additions
and
311 deletions
+1077
-311
center-channel/app/base/api/impl/action/icapi.js
+5
-1
center-channel/app/base/api/impl/action/icpapi.js
+61
-0
center-channel/app/base/api/impl/auth/accessAuth.js
+1
-0
center-channel/app/base/api/impl/auth/channelAccessAuth.js
+1
-0
center-channel/app/base/api/impl/auth/taskapi.js
+28
-7
center-channel/app/base/api/impl/opaction/opOrder.js
+16
-1
center-channel/app/base/db/impl/common/pushfaillogDao.js
+9
-0
center-channel/app/base/db/models/common/pushfaillog.js
+60
-0
center-channel/app/base/service/app.base.js
+143
-21
center-channel/app/base/service/impl/common/centerorderSve.js
+136
-0
center-channel/app/base/service/impl/common/pushlogSve.js
+29
-51
center-channel/app/base/service/impl/utilsSve/utilsAlibankSve.js
+3
-2
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsChannelAuthSve.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+35
-79
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsOpOrderSve.js
+47
-30
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+86
-5
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
+17
-21
center-channel/app/base/service/impl/utilsSve/utilsTmAliyunSve.js
+0
-0
center-channel/app/base/utils/aliyunClient.js
+47
-22
center-channel/app/base/utils/businessManager/pushUtils.js
+5
-53
center-channel/app/config/routes/api.js
+10
-9
center-channel/app/config/settings.js
+7
-0
center-channel/app/front/entry/public/apidoc/README.md
+5
-2
center-channel/app/front/entry/public/apidoc/platform/icpOrder.md
+312
-0
center-channel/提示编码使用
+10
-3
No files found.
center-channel/app/base/api/impl/action/icapi.js
View file @
fc8a297a
...
@@ -6,6 +6,7 @@ class IcAPI extends WEBBase {
...
@@ -6,6 +6,7 @@ class IcAPI extends WEBBase {
super
();
super
();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this
.
centerorderSve
=
system
.
getObject
(
"service.common.centerorderSve"
);
this
.
centerorderSve
=
system
.
getObject
(
"service.common.centerorderSve"
);
// this.utilsFqAliyunSve = system.getObject("service.utilsSve.utilsFqAliyunSve");
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
...
@@ -30,7 +31,10 @@ class IcAPI extends WEBBase {
...
@@ -30,7 +31,10 @@ class IcAPI extends WEBBase {
}
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
// case "testPushBusinessOrder":
// opResult=await this.utilsFqAliyunSve.testPushBusinessOrder();
// break;
case
"submitProgramme"
:
//提交公司注册方案
case
"submitProgramme"
:
//提交公司注册方案
opResult
=
await
this
.
centerorderSve
.
submitProgramme
(
pobj
);
opResult
=
await
this
.
centerorderSve
.
submitProgramme
(
pobj
);
break
;
break
;
...
...
center-channel/app/base/api/impl/action/icpapi.js
0 → 100644
View file @
fc8a297a
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
IcpAPI
extends
APIBase
{
constructor
()
{
super
();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this
.
centerorderSve
=
system
.
getObject
(
"service.common.centerorderSve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
if
(
pobj
.
actionType
==
'getPolicyNeedList'
||
pobj
.
actionType
==
'submitPolicyNeedNotes'
)
{
if
(
!
pobj
.
userInfo
)
{
return
system
.
getResult
(
system
.
noLogin
,
"user no login!"
);
}
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
system
.
noLogin
,
"app is null!"
);
}
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"getNeedSolutionDetailByUser"
:
//获取方案详情
opResult
=
await
this
.
centerorderSve
.
reqCenterOrderApi
(
pobj
,
"action/icpapi/springBoard"
);
break
;
case
"submitIcpProgramme"
:
//icp方案提交
opResult
=
await
this
.
centerorderSve
.
submitIcpProgramme
(
pobj
);
break
;
case
"submitIcpMaterial"
:
//icp材料提交
opResult
=
await
this
.
centerorderSve
.
submitIcpMaterial
(
pobj
);
break
;
case
"acceptIcpPartnerNotification"
:
//icp通知状态变更
opResult
=
await
this
.
centerorderSve
.
acceptIcpPartnerNotification
(
pobj
);
break
;
case
"abolishIcpProgramme"
:
//服务商icp方案关闭
opResult
=
await
this
.
centerorderSve
.
abolishIcpProgramme
(
pobj
);
break
;
// case "updateStausByRefundOrder"://修改退款方案状态
// opResult = await this.needsolutionSve.updateStausByRefundOrder(pobj);
// break;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
IcpAPI
;
\ No newline at end of file
center-channel/app/base/api/impl/auth/accessAuth.js
View file @
fc8a297a
...
@@ -38,6 +38,7 @@ class AccessAuthAPI extends WEBBase {
...
@@ -38,6 +38,7 @@ class AccessAuthAPI extends WEBBase {
opResult
=
await
this
.
utilsTmAliyunSve
.
getAliOssInfo
(
null
,
"ATTORNEY"
,
rpcParam
);
opResult
=
await
this
.
utilsTmAliyunSve
.
getAliOssInfo
(
null
,
"ATTORNEY"
,
rpcParam
);
var
tmo
=
0
;
var
tmo
=
0
;
// opResult = system.getResultSuccess(null, "测试成功");
// opResult = system.getResultSuccess(null, "测试成功");
opResult
=
system
.
getResultSuccess
(
null
,
"测试成功"
);
break
;
break
;
case
"getNeedUserPinByChannelUserId"
:
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户
case
"getNeedUserPinByChannelUserId"
:
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户
var
tmpOpResult
=
await
this
.
utilsAuthSve
.
getLoginByUserName
(
pobj
,
pobj
.
actionBody
);
var
tmpOpResult
=
await
this
.
utilsAuthSve
.
getLoginByUserName
(
pobj
,
pobj
.
actionBody
);
...
...
center-channel/app/base/api/impl/auth/channelAccessAuth.js
View file @
fc8a297a
...
@@ -5,6 +5,7 @@ class ChannelAccessAuthAPI extends WEBBase {
...
@@ -5,6 +5,7 @@ class ChannelAccessAuthAPI extends WEBBase {
super
();
super
();
this
.
utilsChannelAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsChannelAuthSve"
);
this
.
utilsChannelAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsChannelAuthSve"
);
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
//测试用
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
...
...
center-channel/app/base/api/impl/auth/taskapi.js
View file @
fc8a297a
var
WEBBase
=
require
(
"../../web
.base"
);
var
APIBase
=
require
(
"../../api
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
AccessAuthAPI
extends
WEB
Base
{
class
AccessAuthAPI
extends
API
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
this
.
gatewaypushlogSve
=
system
.
getObject
(
"service.common.gatewaypushlogSve"
);
this
.
gatewaypushlogSve
=
system
.
getObject
(
"service.common.gatewaypushlogSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
}
}
async
taskAliIcapi
()
{
async
taskAliIcapi
(){
var
rtn
=
await
this
.
gatewaypushlogSve
.
taskAliIcapi
();
var
rtn
=
await
this
.
gatewaypushlogSve
.
taskAliIcapi
();
return
rtn
;
return
rtn
;
}
}
async
taskAgainPushOneNewBusInfo
(
pobj
,
qobj
,
req
)
{
//再次推送新rpc业务数据
var
rtn
=
await
this
.
utilsPushSve
.
againPushBusInfo
(
pobj
);
if
(
rtn
.
status
==
0
)
{
this
.
pushlogSve
.
delDbPushfaillogById
(
Number
(
pobj
.
id
||
0
));
}
return
rtn
;
}
async
taskAgainPushOneOldBusInfo
(
pobj
,
qobj
,
req
)
{
//再次推送老rpc业务数据
var
rtn
=
await
this
.
aliclient
.
reqbyget
(
pobj
)
return
rtn
;
}
// async taskAgainPushNewBusInfo(pobj, qobj, req) {//再次推送新rpc业务数据
// var rtn = await this.utilsPushSve.againPushBusInfo(pobj);
// return rtn;
// }
// async taskAgainPushOldBusInfo(pobj, qobj, req) {//再次推送老rpc业务数据
// var rtn = await this.aliclient.reqbyget(pobj)
// return rtn;
// }
}
}
module
.
exports
=
AccessAuthAPI
;
module
.
exports
=
AccessAuthAPI
;
\ No newline at end of file
center-channel/app/base/api/impl/opaction/opOrder.js
View file @
fc8a297a
...
@@ -5,6 +5,7 @@ class ProductAPI extends WEBBase {
...
@@ -5,6 +5,7 @@ class ProductAPI extends WEBBase {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsOpOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOpOrderSve"
);
this
.
utilsOpOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOpOrderSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
...
@@ -26,6 +27,20 @@ class ProductAPI extends WEBBase {
...
@@ -26,6 +27,20 @@ class ProductAPI extends WEBBase {
pobj
.
requestId
=
req
.
requestId
;
pobj
.
requestId
=
req
.
requestId
;
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"closeAliTrademarkApplication"
:
//关闭阿里自主申请actionBody:{product_id:产品id,parentCode:商标申请实例id}
var
pushInterfaceResult
=
await
this
.
utilsOpOrderSve
.
getProductInterface
(
pobj
,
pobj
.
actionBody
.
product_id
);
if
(
pushInterfaceResult
.
status
!=
0
)
{
pobj
.
actionBody
.
product_info
.
interface_info
=
pushInterfaceResult
.
data
;
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"closeAliTmApply"
,
1
);
}
break
;
case
"checkTmNameByAli"
:
//检测商标名称是否合规
var
pushInterfaceResult
=
await
this
.
utilsOpOrderSve
.
getProductInterface
(
pobj
,
pobj
.
actionBody
.
product_id
);
if
(
pushInterfaceResult
.
status
!=
0
)
{
pobj
.
actionBody
.
product_info
.
interface_info
=
pushInterfaceResult
.
data
;
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"closeAliTmApply"
,
1
);
}
break
;
case
"updateContacts"
:
//修改订单联系人
case
"updateContacts"
:
//修改订单联系人
opResult
=
await
this
.
utilsOpOrderSve
.
updateContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOpOrderSve
.
updateContacts
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
...
@@ -33,7 +48,7 @@ class ProductAPI extends WEBBase {
...
@@ -33,7 +48,7 @@ class ProductAPI extends WEBBase {
opResult
=
await
this
.
utilsOpOrderSve
.
updateTmOrder
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOpOrderSve
.
updateTmOrder
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
case
"tmConfirm"
:
//商标方案确认
case
"tmConfirm"
:
//商标方案确认
opResult
=
await
this
.
utilsOpOrderSve
.
tmConfirm
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOpOrderSve
.
tmConfirm
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
center-channel/app/base/db/impl/common/pushfaillogDao.js
0 → 100644
View file @
fc8a297a
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
PushFailLogDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
PushFailLogDao
));
}
}
module
.
exports
=
PushFailLogDao
;
\ No newline at end of file
center-channel/app/base/db/models/common/pushfaillog.js
0 → 100644
View file @
fc8a297a
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"pushfaillog"
,
{
appid
:
DataTypes
.
STRING
,
appkey
:
DataTypes
.
STRING
,
requestId
:
DataTypes
.
STRING
,
content
:
DataTypes
.
TEXT
(
'long'
),
resultInfo
:
DataTypes
.
TEXT
(
'long'
),
clientIp
:
DataTypes
.
STRING
,
opTitle
:
DataTypes
.
STRING
(
500
),
failType
:
DataTypes
.
INTEGER
,
//错误类型,1为old-rpc推送失败日志,2为new-rpc推送失败日志,业务处理失败日志
pushNumber
:
DataTypes
.
INTEGER
,
//推送次数
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'center_channel_pushfaillog'
,
validate
:
{
},
indexes
:
[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
center-channel/app/base/service/app.base.js
View file @
fc8a297a
...
@@ -44,20 +44,50 @@ class AppServiceBase {
...
@@ -44,20 +44,50 @@ class AppServiceBase {
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
async
restPostUrl
(
pobj
,
url
)
{
async
restPostUrl
(
pobj
,
url
)
{
var
rtn
=
await
this
.
restClient
.
execPost
(
pobj
,
url
);
try
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
var
rtn
=
await
this
.
restClient
.
execPost
(
pobj
,
url
);
return
system
.
getResult
(
null
,
"restPost data is empty"
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"restPost data is empty"
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
}
catch
(
e
)
{
var
errorMsg
=
"error:"
+
e
.
stack
;
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/app.base.js/restPostUrl"
,
content
:
errorMsg
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->restPostUrl"
,
});
return
system
.
getResult
(
null
,
errorMsg
);
}
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
}
}
async
execPostUrl
(
pobj
,
url
)
{
async
execPostUrl
(
pobj
,
url
)
{
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
try
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
return
system
.
getResult
(
null
,
"execPost data is empty"
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
}
catch
(
e
)
{
var
errorMsg
=
"error:"
+
e
.
stack
;
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/app.base.js/restPostUrl"
,
content
:
errorMsg
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->restPostUrl"
,
});
return
system
.
getResult
(
null
,
errorMsg
);
}
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
}
}
async
opAliyunRpcVerifyParam
(
pobj
)
{
//参数信息验证
async
opAliyunRpcVerifyParam
(
pobj
)
{
//参数信息验证
var
verify
=
system
.
getResultSuccess
();
var
verify
=
system
.
getResultSuccess
();
...
@@ -85,30 +115,122 @@ class AppServiceBase {
...
@@ -85,30 +115,122 @@ class AppServiceBase {
var
rtn
=
await
aliyunClient
.
reqCustomByGet
(
params
);
var
rtn
=
await
aliyunClient
.
reqCustomByGet
(
params
);
return
rtn
;
return
rtn
;
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
pushlogSve
.
createDb
({
var
errorMsg
=
"error:"
+
e
.
stack
;
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunRpcReq"
,
content
:
errorMsg
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->opAliyunRpcReq"
,
});
return
system
.
getResult
(
null
,
errorMsg
);
}
}
/**
* 阿里RPC调用-post请求
* @param {*} pobj {action: rpcParam.action,reqbody: pobj.actionBody,rpcParam: rpcParam}
* @param {*} params {为阿里的接口参数}
*/
async
opAliyunRpcReqByPost
(
pobj
,
params
)
{
try
{
// var action = obj.action;
// var reqbody = obj.reqbody;
// var rpcParam = obj.rpcParam;
var
aliyunClient
=
system
.
getObject
(
"util.aliyunClient"
);
var
rtn
=
await
aliyunClient
.
reqCustomByPost
(
params
);
return
rtn
;
}
catch
(
e
)
{
var
errorMsg
=
"error:"
+
e
.
stack
;
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunRpcReqByPost"
,
content
:
errorMsg
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->opAliyunRpcReqByPost"
,
});
return
system
.
getResult
(
null
,
errorMsg
);
}
}
async
disposePushResult
(
pobj
,
result
,
opTitleDesc
)
{
//处理结果信息--内部使用
var
opType
=
pobj
.
opType
||
""
;
if
(
result
.
status
!=
0
)
{
this
.
pushlogSve
.
createFailLogDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
op
:
JSON
.
stringify
(
pobj
.
interface_info
),
//推送的接口信息
requestId
:
pobj
.
requestId
||
""
,
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
"error:"
+
e
.
stack
,
resultInfo
:
JSON
.
stringify
(
result
),
returnType
:
'0'
,
clientIp
:
pobj
.
clientIp
||
""
,
opTitle
:
pobj
.
opType
+
"推送操作异常->opAliyunClientPost"
failType
:
2
,
opTitle
:
opType
+
"推送操作失败->"
+
opTitleDesc
,
pushNumber
:
pobj
.
pushNumber
||
1
});
});
//日志记录
result
.
data
=
null
;
return
result
;
}
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"推送业务类型:"
+
opType
,
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
result
),
returnType
:
'1'
,
opTitle
:
opType
+
"数据推送成功->"
+
opTitleDesc
});
result
.
data
=
null
;
return
result
;
}
/**
* 处理失败的结果信息--内部使用
* @param {*} pobj
* @param {*} result
* @param {*} opTitleDesc
* @param {*} failType 错误类型,1为old-rpc推送失败日志,2为new-rpc推送失败日志,业务处理失败日志
*/
async
disposePushResultFail
(
pobj
,
result
,
opTitleDesc
,
failType
)
{
//处理失败的结果信息--内部使用
var
opType
=
pobj
.
opType
||
""
;
this
.
pushlogSve
.
createFailLogDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
result
),
clientIp
:
pobj
.
clientIp
||
""
,
failType
:
failType
||
2
,
opTitle
:
opType
+
"推送操作失败->"
+
opTitleDesc
,
pushNumber
:
pobj
.
pushNumber
||
1
});
result
.
data
=
null
;
return
result
;
}
async
getAliossjavaFileUrl
(
pobj
,
params
)
{
//上传ali oss 文件调用
try
{
var
aliOssFileInfo
=
await
this
.
execPostUrl
(
params
,
settings
.
aliossjavaUrl
());
if
(
aliOssFileInfo
)
{
var
fileUrl
=
params
.
filedir
+
"/"
+
params
.
objectName
;
return
system
.
getResultSuccess
(
fileUrl
);
}
return
system
.
getResult
(
null
,
"java ali oss upload fail"
);
}
catch
(
e
)
{
this
.
logCtl
.
error
({
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"
center-channel/app/base/service/impl/utilsSve/opAliyunClientPost.js/"
+
methodName
,
op
:
"
service/app.base.js/getAliossjavaFileUrl"
,
content
:
"error:"
+
e
.
stack
,
content
:
"error:"
+
e
.
stack
,
// clientIp: pobj.clientIp,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->opAliyunClientPost
"
,
optitle
:
pobj
.
opType
||
""
+
"aliossjava-upload阿里上传文件操作异常->getAliossjavaFileUrl
"
,
});
});
return
system
.
getResult
(
null
,
"推送
error"
);
return
system
.
getResult
(
-
200
,
"java ali oss upload
error"
);
}
}
}
}
/*
/*
返回20位业务订单号
返回20位业务订单号
prefix:业务前缀
prefix:业务前缀
...
...
center-channel/app/base/service/impl/common/centerorderSve.js
View file @
fc8a297a
...
@@ -9,6 +9,7 @@ class CenterorderService {
...
@@ -9,6 +9,7 @@ class CenterorderService {
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
//测试用
};
};
//调用center-order
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
...
@@ -20,6 +21,8 @@ class CenterorderService {
...
@@ -20,6 +21,8 @@ class CenterorderService {
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
return
data
;
}
}
//--------------------------阿里IC---start--------------------------------------------------------
//提交公司注册方案
//提交公司注册方案
async
submitProgramme
(
pobj
)
{
async
submitProgramme
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
...
@@ -277,6 +280,139 @@ class CenterorderService {
...
@@ -277,6 +280,139 @@ class CenterorderService {
}
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
//--------------------------阿里IC---end--------------------------------------------------------
//--------------------------阿里ICP---start--------------------------------------------------------
//提交公司注册方案
async
submitIcpProgramme
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/icpapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
){
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
solutionContent
)
==
"string"
){
ab
.
solutionContent
=
JSON
.
parse
(
ab
.
solutionContent
);
}
if
(
typeof
(
needsolution
.
solutionContent
)
==
"string"
){
needsolution
.
solutionContent
=
JSON
.
parse
(
needsolution
.
solutionContent
);
}
var
solution
=
needsolution
.
solutionContent
.
solution
;
//推送数据至阿里
var
bizType
=
needinfo
.
channelTypeCode
;
//业务类型里
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
};
var
self
=
this
;
//推送方案
// this.pushIcpSolution(pushObj,needsolution.solutionNo,pobj.appInfo,self);
return
system
.
getResultSuccess
();
}
return
res
;
}
//推送ICP方案
async
pushIcpSolution
(
pushObj
,
solutionNo
,
appInfo
,
self
){
//推送方案信息
var
pushRes
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SubmitIcpSolution"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
if
(
pushRes
&&
pushRes
.
status
==
0
&&
pushRes
.
data
){
var
resData
=
pushRes
.
data
;
if
(
resData
.
BizId
){
var
reqObj2
=
{
actionType
:
"receiveProgrammeNo"
,
appInfo
:
appInfo
,
actionBody
:{
solutionNo
:
solutionNo
,
solutionBizId
:
resData
.
BizId
}
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
if
(
a
&&
a
.
status
==
0
){
//推送方案确认信息
await
self
.
aliclient
.
reqbyget
({
action
:
"ConfirmIntention"
,
reqbody
:{
BizId
:
resData
.
BizId
}});
}
}
}
}
//材料链接转换
async
materialUrlConversion
(
pobj
){
// if(!pobj || !pobj.actionBody || !pobj.actionBody.material){
// return pobj;
// }
// var material = pobj.actionBody.material;
// if(material.PartnerBusinessLicense){//营业执照
// var aliPartnerBusinessLicense = await this.utilsTmAliyunSve.getAliOssFileUrl("trade-mark-user-upload", pobj, this.utilsTmAliyunSve.aliOssFileType.BUSINESS_LICENSE, material.PartnerBusinessLicense, rpcParam);
// }
}
//icp材料提交
async
submitIcpMaterial
(
pobj
)
{
// pobj = await this.materialUrlConversion(pobj);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/icpapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
){
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
material
)
==
"string"
){
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
}
var
material
=
ab
.
material
;
//推送数据至阿里
var
BizId
=
ab
.
BizId
;
//⽅案业务ID
var
pushObj
=
{
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
// self.aliclient.reqbyget({action:"SavePartnerSubmitMaterial",reqbody:pushObj});
return
system
.
getResultSuccess
();
}
return
res
;
}
//icp通知状态变更
async
acceptIcpPartnerNotification
(
pobj
){
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/icpapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
){
var
ab
=
pobj
.
actionBody
;
//推送数据至阿里
var
pushObj
=
res
.
data
;
//推送方案
//this.aliclient.reqbyget({action:"AcceptPartnerNotification",reqbody:pushObj});
return
system
.
getResultSuccess
();
}
return
res
;
}
//服务商icp方案关闭
async
abolishIcpProgramme
(
pobj
){
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/icpapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
){
var
needsolution
=
res
.
data
;
//方案信息
var
ab
=
pobj
.
actionBody
;
if
(
typeof
(
ab
.
material
)
==
"string"
){
ab
.
material
=
JSON
.
parse
(
ab
.
material
);
}
//推送数据至阿里
var
pushObj
=
{
BizId
:
ab
.
BizId
,
Note
:
ab
.
Note
};
//推送方案
//this.aliclient.reqbyget({action:"CloseIcpProduce",reqbody:pushObj});
return
system
.
getResultSuccess
();
}
return
res
;
}
//--------------------------阿里ICP---end--------------------------------------------------------
}
}
module
.
exports
=
CenterorderService
;
module
.
exports
=
CenterorderService
;
// var task = new CenterorderService();
// var task = new CenterorderService();
...
...
center-channel/app/base/service/impl/common/pushlogSve.js
View file @
fc8a297a
...
@@ -4,67 +4,45 @@ var settings = require("../../../../config/settings");
...
@@ -4,67 +4,45 @@ var settings = require("../../../../config/settings");
class
PushlogService
extends
ServiceBase
{
class
PushlogService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"common"
,
ServiceBase
.
getDaoName
(
PushlogService
));
super
(
"common"
,
ServiceBase
.
getDaoName
(
PushlogService
));
//this.appDao=system.getObject("db.appDao");
this
.
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
this
.
opLogUrl
=
settings
.
apiconfig
.
opLogUrl
();
this
.
pushfaillogDao
=
system
.
getObject
(
"db.common.pushfaillogDao"
);
this
.
opLogEsIsAdd
=
settings
.
apiconfig
.
opLogEsIsAdd
();
}
}
async
create
(
qobj
)
{
async
createDb
(
qobj
)
{
if
(
!
qobj
||
!
qobj
.
op
||
qobj
.
op
.
indexOf
(
"metaCtl/getUiConfig"
)
>=
0
||
qobj
.
op
.
indexOf
(
"userCtl/checkLogin"
)
>=
0
||
qobj
.
op
.
indexOf
(
"getDicConfig"
)
>=
0
||
qobj
.
op
.
indexOf
(
"getRouteConfig"
)
>=
0
||
qobj
.
op
.
indexOf
(
"getRsConfig"
)
>=
0
)
{
return
null
;
}
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
rtn
=
null
;
try
{
try
{
// var myDate = new Date();
// var tmpTitle=myDate.toLocaleString()+":"+qobj.optitle;
qobj
.
optitle
=
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
":"
+
qobj
.
optitle
;
qobj
.
optitle
=
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
":"
+
qobj
.
optitle
;
if
(
this
.
opLogEsIsAdd
==
1
)
{
qobj
.
content
=
qobj
.
content
.
replace
(
"field list"
,
"字段列表"
)
qobj
.
created_at
=
(
new
Date
()).
getTime
();
//往Es中写入日志
var
addEsData
=
JSON
.
stringify
(
qobj
);
rc
.
execPost
(
qobj
,
this
.
opLogUrl
);
}
else
{
//解决日志大于4000写入的问题
if
(
qobj
.
content
.
length
>
4980
)
{
qobj
.
content
=
qobj
.
content
.
substring
(
0
,
4980
);
}
this
.
dao
.
create
(
qobj
);
}
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"addLog------error-----------------------*****************"
);
qobj
.
content
=
e
.
stack
;
//解决日志大于4000写入的问题
if
(
qobj
.
content
.
length
>
4980
)
{
qobj
.
content
=
qobj
.
content
.
substring
(
0
,
4980
);
}
this
.
dao
.
create
(
qobj
);
this
.
dao
.
create
(
qobj
);
}
catch
(
e
)
{
//日志记录
this
.
logCtl
.
error
({
appid
:
qobj
.
appid
||
""
,
appkey
:
qobj
.
appkey
||
""
,
requestId
:
qobj
.
requestId
||
""
,
op
:
qobj
.
op
||
""
,
content
:
qobj
.
content
+
"-->error:"
+
e
.
stack
,
clientIp
:
qobj
.
clientIp
||
""
,
optitle
:
qobj
.
optitle
||
""
+
"-->添加日志失败center_channel_pushlog->createDb"
,
});
}
}
}
}
async
createDb
(
qobj
)
{
async
createFailLogDb
(
qobj
)
{
if
(
!
qobj
||
!
qobj
.
op
||
qobj
.
op
.
indexOf
(
"metaCtl/getUiConfig"
)
>=
0
||
qobj
.
op
.
indexOf
(
"userCtl/checkLogin"
)
>=
0
||
qobj
.
op
.
indexOf
(
"getDicConfig"
)
>=
0
||
qobj
.
op
.
indexOf
(
"getRouteConfig"
)
>=
0
||
qobj
.
op
.
indexOf
(
"getRsConfig"
)
>=
0
)
{
return
null
;
}
try
{
try
{
qobj
.
optitle
=
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
":"
+
qobj
.
optitle
;
qobj
.
optitle
=
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
":"
+
qobj
.
optitle
;
this
.
d
ao
.
create
(
qobj
);
this
.
pushfaillogD
ao
.
create
(
qobj
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"addLog------error-----------------------*****************"
);
//日志记录
qobj
.
content
=
e
.
stack
;
this
.
logCtl
.
error
({
//解决日志大于4000写入的问题
appid
:
qobj
.
appid
||
""
,
if
(
qobj
.
content
.
length
>
4980
)
{
appkey
:
qobj
.
appkey
||
""
,
qobj
.
content
=
qobj
.
content
.
substring
(
0
,
4980
);
requestId
:
qobj
.
requestId
||
""
,
}
op
:
qobj
.
op
||
""
,
this
.
dao
.
create
(
qobj
);
content
:
qobj
.
content
+
"-->error:"
+
e
.
stack
,
clientIp
:
qobj
.
clientIp
||
""
,
optitle
:
qobj
.
optitle
||
""
+
"-->添加日志失败center_channel_pushfaillog->createFailLogDb"
,
});
}
}
}
}
async
delDbPushfaillogById
(
id
)
{
this
.
pushfaillogDao
.
bulkDeleteByWhere
({
where
:
{
id
:
id
}
});
}
}
}
module
.
exports
=
PushlogService
;
module
.
exports
=
PushlogService
;
center-channel/app/base/service/impl/utilsSve/utilsAlibankSve.js
View file @
fc8a297a
...
@@ -2,7 +2,7 @@ var system = require("../../../system");
...
@@ -2,7 +2,7 @@ var system = require("../../../system");
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
//阿里支付类
class
utilsTlBankSve
extends
AppServiceBase
{
class
utilsTlBankSve
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -26,7 +26,8 @@ class utilsTlBankSve extends AppServiceBase {
...
@@ -26,7 +26,8 @@ class utilsTlBankSve extends AppServiceBase {
return
orderResult
;
return
orderResult
;
}
}
pobj
.
actionBody
.
body_desc
=
orderResult
.
data
.
orderProduct
.
channelItemName
;
pobj
.
actionBody
.
body_desc
=
orderResult
.
data
.
orderProduct
.
channelItemName
;
pobj
.
actionBody
.
total_fee
=
Number
(
orderResult
.
data
.
receiptVoucher
.
totalSum
)
*
100
;
pobj
.
actionBody
.
product_id
=
orderResult
.
data
.
orderProduct
.
id
;
pobj
.
actionBody
.
total_fee
=
Number
(
orderResult
.
data
.
receiptVoucher
.
totalSum
);
pobj
.
actionBody
.
order_num
=
orderResult
.
data
.
receiptVoucher
.
sourceOrderNo
;
pobj
.
actionBody
.
order_num
=
orderResult
.
data
.
receiptVoucher
.
sourceOrderNo
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppUrl
+
"payment/aliPayment/getPayInfo"
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppUrl
+
"payment/aliPayment/getPayInfo"
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
View file @
fc8a297a
...
@@ -2,7 +2,7 @@ var system = require("../../../system");
...
@@ -2,7 +2,7 @@ var system = require("../../../system");
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
//
商标查询
操作
//
用户权限
操作
class
UtilsAuthService
extends
AppServiceBase
{
class
UtilsAuthService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
...
center-channel/app/base/service/impl/utilsSve/utilsChannelAuthSve.js
View file @
fc8a297a
...
@@ -2,7 +2,7 @@ var system = require("../../../system");
...
@@ -2,7 +2,7 @@ var system = require("../../../system");
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
//
商标查询
操作
//
渠道用户权限
操作
class
UtilsChannelAuthService
extends
AppServiceBase
{
class
UtilsChannelAuthService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
...
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
View file @
fc8a297a
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//此类用来db中配置来进行调用
//此类用来db中配置来进行调用
-主要功能是推送蜂擎业务
class
UtilsFqAliyunService
extends
AppServiceBase
{
class
UtilsFqAliyunService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
}
}
async
pushOrderBusinessByProductCode2Fq
(
pobj
)
{
//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
async
pushOrderBusinessByProductCode2Fq
(
pobj
)
{
//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
var
verify
=
await
this
.
verifyParam
(
pobj
);
var
verify
Result
=
await
this
.
verifyParam
(
pobj
);
var
orderInfo
=
pobj
.
actionBody
.
order_info
;
var
orderInfo
=
pobj
.
actionBody
.
order_info
;
var
orderContact
=
pobj
.
actionBody
.
order_contact
;
var
orderContact
=
pobj
.
actionBody
.
order_contact
;
var
productInfo
=
pobj
.
actionBody
.
product_info
;
var
productInfo
=
pobj
.
actionBody
.
product_info
;
if
(
!
orderInfo
)
{
if
(
!
orderInfo
)
{
verify
=
system
.
getResult
(
null
,
"orderInfo can not be empty,100420"
);
verify
Result
=
system
.
getResult
(
null
,
"orderInfo can not be empty,100420"
);
}
}
if
(
!
orderInfo
.
orderStatus
||
orderInfo
.
orderStatus
<
2
)
{
if
(
!
orderInfo
.
orderStatus
||
orderInfo
.
orderStatus
<
2
)
{
verify
=
system
.
getResult
(
null
,
"orderInfo status must be paid,100423"
);
verify
Result
=
system
.
getResult
(
null
,
"orderInfo status must be paid,100423"
);
}
}
if
(
!
orderContact
||
!
orderContact
.
mobile
)
{
if
(
!
orderContact
||
!
orderContact
.
mobile
)
{
verify
=
system
.
getResult
(
null
,
"orderInfo.orderContact.mobile can not be empty,100425"
);
verify
Result
=
system
.
getResult
(
null
,
"orderInfo.orderContact.mobile can not be empty,100425"
);
}
}
if
(
!
productInfo
||
!
productInfo
.
service_business_code
)
{
if
(
!
productInfo
||
!
productInfo
.
service_business_code
)
{
verify
=
system
.
getResult
(
null
,
"orderInfo.productInfo.service_business_code can not be empty,100427"
);
verify
Result
=
system
.
getResult
(
null
,
"orderInfo.productInfo.service_business_code can not be empty,100427"
);
}
}
if
(
!
productInfo
||
!
productInfo
.
price_item
||
!
productInfo
.
price_item
.
service_code
)
{
if
(
!
productInfo
||
!
productInfo
.
price_item
||
!
productInfo
.
price_item
.
service_code
)
{
verify
=
system
.
getResult
(
null
,
"orderInfo.productInfo.price_item.service_code can not be empty,100430"
);
verify
Result
=
system
.
getResult
(
null
,
"orderInfo.productInfo.price_item.service_code can not be empty,100430"
);
}
}
if
(
verify
.
status
!=
0
)
{
if
(
verifyResult
.
status
!=
0
)
{
this
.
pushlogSve
.
createDb
({
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"fq->pushOrderBusinessByProductCode2Fq->verifyResult"
);
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"暂无推送的接口信息"
+
",verify-msg:"
+
verify
.
msg
,
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
""
,
returnType
:
'0'
,
opTitle
:
pobj
.
opType
+
"推送操作失败->opAliyunClientPost"
});
return
verify
;
}
}
var
interface_params_info
=
verify
.
data
;
var
interface_params_info
=
verify
Result
.
data
;
var
params
=
{
var
params
=
{
idempotentId
:
orderInfo
.
orderNo
,
// 是 业务 ID
idempotentId
:
orderInfo
.
orderNo
,
// 是 业务 ID
idempotentSource
:
productInfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
idempotentSource
:
productInfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
...
@@ -53,7 +43,8 @@ class UtilsFqAliyunService extends AppServiceBase {
...
@@ -53,7 +43,8 @@ class UtilsFqAliyunService extends AppServiceBase {
productId
:
productInfo
.
price_item
.
service_code
,
// 是 产品 ID
productId
:
productInfo
.
price_item
.
service_code
,
// 是 产品 ID
productQuantity
:
orderInfo
.
quantity
,
// 是 产品数量
productQuantity
:
orderInfo
.
quantity
,
// 是 产品数量
};
};
var
result
=
this
.
opAliyunClientPost
(
pobj
,
"pushOrderBusiness"
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
params
);
var
result
=
await
this
.
opAliyunClientPost
(
pobj
,
"pushOrderBusiness"
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
params
);
return
await
this
.
disposePushResult
(
pobj
,
result
,
"fq->pushOrderBusinessByProductCode2Fq->result"
);
}
}
/**
/**
...
@@ -62,87 +53,52 @@ class UtilsFqAliyunService extends AppServiceBase {
...
@@ -62,87 +53,52 @@ class UtilsFqAliyunService extends AppServiceBase {
* @param {*} pobj
* @param {*} pobj
*/
*/
async
pushAliBusiness2Fq
(
pobj
)
{
//推送阿里信息操作到峰擎
async
pushAliBusiness2Fq
(
pobj
)
{
//推送阿里信息操作到峰擎
var
verify
=
await
this
.
verifyParam
(
pobj
);
var
verifyResult
=
await
this
.
verifyParam
(
pobj
);
if
(
verify
.
status
!=
0
)
{
if
(
verifyResult
.
status
!=
0
)
{
this
.
pushlogSve
.
createDb
({
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"fq->pushAliBusiness2Fq->verifyResult"
);
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"暂无推送的接口信息"
+
",verify-msg:"
+
verify
.
msg
,
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
""
,
returnType
:
'0'
,
opTitle
:
pobj
.
opType
+
"推送操作失败->opAliyunClientPost"
});
return
verify
;
}
}
var
interface_params_info
=
verify
.
data
;
var
interface_params_info
=
verify
.
data
;
this
.
opAliyunClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
pobj
.
actionBody
);
var
result
=
await
this
.
opAliyunClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
pobj
.
actionBody
);
}
return
await
this
.
disposePushResult
(
pobj
,
result
,
"fq->pushAliBusiness2Fq->result"
);
async
verifyParam
(
pobj
)
{
//参数信息验证
var
verify
=
system
.
getResultSuccess
();
if
(
!
pobj
.
interface_params
)
{
verify
=
system
.
getResult
(
null
,
"interface_params can not be empty,100400"
);
}
var
interface_params_info
=
JSON
.
parse
(
pobj
.
interface_params
);
if
(
!
interface_params_info
||
!
interface_params_info
.
opUrl
||
!
interface_params_info
.
key
||
!
interface_params_info
.
secret
)
{
verify
=
system
.
getResult
(
null
,
"interface_params(opUrl、key、secret) can not be empty,100410"
);
}
verify
.
data
=
interface_params_info
;
return
verify
;
}
}
//--------------------------------------------------内部辅助方法-------------------start-----------------
async
opAliyunClientPost
(
pobj
,
url
,
key
,
secret
,
params
)
{
async
opAliyunClientPost
(
pobj
,
url
,
key
,
secret
,
params
)
{
try
{
try
{
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
var
rtn
=
await
rc
.
post
(
url
,
key
,
secret
,
params
);
var
rtn
=
await
rc
.
post
(
url
,
key
,
secret
,
params
);
if
(
rtn
.
code
!=
200
&&
rtn
.
success
!=
true
)
{
if
(
rtn
.
code
!=
200
&&
rtn
.
success
!=
true
)
{
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
op
:
JSON
.
stringify
(
pobj
.
interface_info
),
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
rtn
),
returnType
:
'0'
,
opTitle
:
pobj
.
opType
+
"推送操作出错->opAliyunClientPost"
});
return
system
.
getResult
(
null
,
"推送失败,失败原因:"
+
rtn
.
errorMsg
+
",selfrequestId="
+
pobj
.
requestId
+
",requestId="
+
rtn
.
requestId
);
return
system
.
getResult
(
null
,
"推送失败,失败原因:"
+
rtn
.
errorMsg
+
",selfrequestId="
+
pobj
.
requestId
+
",requestId="
+
rtn
.
requestId
);
}
}
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
op
:
JSON
.
stringify
(
pobj
.
interface_info
),
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
rtn
),
returnType
:
'1'
,
opTitle
:
pobj
.
opType
+
"数据推送成功->opAliyunClientPost"
});
return
system
.
getResultSuccess
(
null
,
"推送成功"
);
return
system
.
getResultSuccess
(
null
,
"推送成功"
);
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
op
:
JSON
.
stringify
(
pobj
.
interface_info
),
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
"error:"
+
e
.
stack
,
returnType
:
'0'
,
opTitle
:
pobj
.
opType
+
"推送操作异常->opAliyunClientPost"
});
//日志记录
//日志记录
this
.
logCtl
.
error
({
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"
center-channel/app/base/
service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
content
:
"error:"
+
e
.
stack
,
content
:
"error:"
+
e
.
stack
,
// clientIp: pobj.clientIp,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->opAliyunClientPost"
,
optitle
:
pobj
.
opType
+
"推送操作异常->opAliyunClientPost"
,
});
});
return
system
.
getResult
(
null
,
"推送
error"
);
return
system
.
getResult
(
null
,
"推送
操作异常->opAliyunClientPost->error:"
+
e
.
stack
);
}
}
}
}
async
verifyParam
(
pobj
)
{
//参数信息验证
var
verify
=
system
.
getResultSuccess
();
if
(
!
pobj
.
interface_params
)
{
verify
=
system
.
getResult
(
null
,
"interface_params can not be empty,100400"
);
}
var
interface_params_info
=
JSON
.
parse
(
pobj
.
interface_params
);
if
(
!
interface_params_info
||
!
interface_params_info
.
opUrl
||
!
interface_params_info
.
key
||
!
interface_params_info
.
secret
)
{
verify
=
system
.
getResult
(
null
,
"interface_params(opUrl、key、secret) can not be empty,100410"
);
}
verify
.
data
=
interface_params_info
;
return
verify
;
}
//--------------------------------------------------内部辅助方法-------------------end-----------------
}
}
module
.
exports
=
UtilsFqAliyunService
;
module
.
exports
=
UtilsFqAliyunService
;
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
fc8a297a
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//
商标查询操作
//
需求操作类
class
UtilsNeedService
extends
AppServiceBase
{
class
UtilsNeedService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
...
center-channel/app/base/service/impl/utilsSve/utilsOpOrderSve.js
View file @
fc8a297a
...
@@ -2,33 +2,57 @@ const system = require("../../../system");
...
@@ -2,33 +2,57 @@ const system = require("../../../system");
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
querystring
=
require
(
'querystring'
);
const
querystring
=
require
(
'querystring'
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//订单操作类
class
UtilsOpOrderService
extends
AppServiceBase
{
class
UtilsOpOrderService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
}
}
async
updateContacts
(
pobj
,
actionBody
)
{
async
getProductInterface
(
appInfo
,
product_id
)
{
//获取产品调用接口
var
getProductInterfaceUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
getProductInterfaceObj
=
{
"actionType"
:
"getProductInterface"
,
"appInfo"
:
appInfo
,
"actionBody"
:
{
"product_id"
:
product_id
}
};
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
getProductInterfaceObj
,
getProductInterfaceUrl
);
return
productItemInterfaceResult
;
}
async
updateContacts
(
pobj
,
actionBody
)
{
//修改联系人
if
(
!
actionBody
.
orderNo
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100310"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100310"
);
}
}
var
reqUrl
=
this
.
centerOrderUrl
+
"opaction/opOrder/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
this
.
opUpdatePushInfo
(
result
,
pobj
,
actionBody
,
"pushUpdateOrderContacts"
);
if
(
result
.
status
!=
0
)
{
result
.
data
=
null
;
return
result
;
}
if
(
result
.
data
.
orderStatus
==
2
)
{
this
.
opUpdatePushInfo
(
result
,
pobj
,
actionBody
,
"pushUpdateOrderContacts"
);
}
//状态为付款的订单进行推送
result
.
data
=
null
;
result
.
data
=
null
;
return
result
;
return
result
;
}
}
async
updateTmOrder
(
pobj
,
actionBody
)
{
async
updateTmOrder
(
pobj
,
actionBody
)
{
//修改商标信息
if
(
!
actionBody
.
orderNo
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100320"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100320"
);
}
}
var
reqUrl
=
this
.
centerOrderUrl
+
"opaction/opOrder/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
this
.
opUpdatePushInfo
(
result
,
pobj
,
"pushUpdateOrder"
);
if
(
result
.
status
!=
0
)
{
result
.
data
=
null
;
return
result
;
}
if
(
result
.
data
.
orderStatus
==
2
)
{
this
.
opUpdatePushInfo
(
result
,
pobj
,
"pushUpdateOrder"
);
this
.
opUpdatePushInfo
(
result
,
pobj
,
"updateAliTmApplicant"
);
}
//状态为付款的订单进行推送
result
.
data
=
null
;
result
.
data
=
null
;
return
result
;
return
result
;
}
}
async
opUpdatePushInfo
(
result
,
pobj
,
opType
)
{
async
opUpdatePushInfo
(
result
,
pobj
,
opType
)
{
//操作商标信息修改推送的操作-本类内部使用
if
(
result
.
status
==
0
&&
result
.
data
.
orderStatus
<
4
)
{
if
(
result
.
status
==
0
&&
result
.
data
.
orderStatus
<
4
)
{
result
.
data
.
appInfo
=
{
result
.
data
.
appInfo
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
...
@@ -45,34 +69,31 @@ class UtilsOpOrderService extends AppServiceBase {
...
@@ -45,34 +69,31 @@ class UtilsOpOrderService extends AppServiceBase {
appInfo
:
pobj
.
appInfo
,
appInfo
:
pobj
.
appInfo
,
actionBody
:
result
.
data
actionBody
:
result
.
data
}
}
delete
result
.
data
[
"orderStatus"
];
this
.
utilsPushSve
.
pushBusInfo
(
tmpPobj
,
opType
,
1
);
this
.
utilsPushSve
.
pushBusInfo
(
tmpPobj
,
opType
,
1
);
}
}
}
}
async
tmConfirm
(
pobj
,
actionBody
)
{
//商标方案确认
async
tmConfirm
(
pobj
,
actionBody
){
//商标方案确认
if
(
!
actionBody
.
orderNo
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100025"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100025"
);
}
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
&&
result
.
status
==
0
&&
result
.
data
)
{
if
(
result
&&
result
.
status
==
0
&&
result
.
data
)
{
this
.
pushTmConfirm
(
result
,
pobj
,
actionBody
);
//推送方案确认信息
this
.
pushTmConfirm
(
result
,
pobj
,
actionBody
);
//推送方案确认信息
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
return
result
;
return
result
;
}
}
//推送方案确认信息
async
pushTmConfirm
(
result
,
pobj
,
actionBody
)
{
//推送方案确认信息
async
pushTmConfirm
(
result
,
pobj
,
actionBody
){
var
orderdelivery
=
result
.
data
;
var
orderdelivery
=
result
.
data
;
var
deliveryContent
=
orderdelivery
.
deliveryContent
;
var
deliveryContent
=
orderdelivery
.
deliveryContent
;
if
(
deliveryContent
)
{
if
(
deliveryContent
)
{
var
pushObj
=
{
//推送参数
var
pushObj
=
{
//推送参数
serviceNo
:
deliveryContent
.
serviceNo
,
serviceNo
:
deliveryContent
.
serviceNo
,
isConfirm
:
actionBody
.
isConfirm
,
isConfirm
:
actionBody
.
isConfirm
,
channelCode
:
deliveryContent
.
channelCode
,
channelCode
:
deliveryContent
.
channelCode
,
notes
:
actionBody
.
notes
||
""
,
notes
:
actionBody
.
notes
||
""
,
appInfo
:
pobj
.
appInfo
appInfo
:
pobj
.
appInfo
};
};
var
tmpPobj
=
{
var
tmpPobj
=
{
...
@@ -82,9 +103,9 @@ class UtilsOpOrderService extends AppServiceBase {
...
@@ -82,9 +103,9 @@ class UtilsOpOrderService extends AppServiceBase {
//获取产品详情
//获取产品详情
var
getProductDetailUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
getProductDetailUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
getProductDetailObj
=
{
var
getProductDetailObj
=
{
"actionType"
:
"getProductDetail"
,
"actionType"
:
"getProductDetail"
,
"appInfo"
:
pobj
.
appInfo
,
"appInfo"
:
pobj
.
appInfo
,
"actionBody"
:
{
"channelItemCode"
:
deliveryContent
.
itemCode
}
"actionBody"
:
{
"channelItemCode"
:
deliveryContent
.
itemCode
}
};
};
var
productItemResult
=
await
this
.
restPostUrl
(
getProductDetailObj
,
getProductDetailUrl
);
var
productItemResult
=
await
this
.
restPostUrl
(
getProductDetailObj
,
getProductDetailUrl
);
if
(
productItemResult
.
status
!=
0
)
{
if
(
productItemResult
.
status
!=
0
)
{
...
@@ -92,16 +113,12 @@ class UtilsOpOrderService extends AppServiceBase {
...
@@ -92,16 +113,12 @@ class UtilsOpOrderService extends AppServiceBase {
}
}
tmpPobj
.
actionBody
.
product_info
=
productItemResult
.
data
;
tmpPobj
.
actionBody
.
product_info
=
productItemResult
.
data
;
tmpPobj
.
actionBody
.
product_id
=
tmpPobj
.
actionBody
.
product_info
.
id
;
tmpPobj
.
actionBody
.
product_id
=
tmpPobj
.
actionBody
.
product_info
.
id
;
//获取推送接口信息
//获取推送接口并推送
var
getProductInterfaceUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
pushInterfaceResult
=
await
this
.
getProductInterface
(
pobj
.
appInfo
,
tmpPobj
.
actionBody
.
product_id
);
var
getProductInterfaceObj
=
{
if
(
pushINterfaceResult
.
status
==
0
)
{
"actionType"
:
"getProductInterface"
,
tmpPobj
.
actionBody
.
product_info
.
interface_info
=
pushInterfaceResult
.
data
;
"appInfo"
:
pobj
.
appInfo
,
this
.
utilsPushSve
.
pushBusInfo
(
tmpPobj
,
"pushOpSolution"
,
1
);
"actionBody"
:{
"product_id"
:
tmpPobj
.
actionBody
.
product_id
}
}
};
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
getProductInterfaceObj
,
getProductInterfaceUrl
);
tmpPobj
.
actionBody
.
product_info
.
interface_info
=
productItemInterfaceResult
.
data
;
this
.
utilsPushSve
.
pushBusInfo
(
tmpPobj
,
"pushOpSolution"
,
1
);
}
}
}
}
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
fc8a297a
...
@@ -356,7 +356,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -356,7 +356,7 @@ class UtilsOrderService extends AppServiceBase {
//日志记录
//日志记录
this
.
logCtl
.
info
({
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调参数:,method="
+
parmas
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调参数:,method="
+
parmas
.
trxcode
,
op
:
"
center-channel/app/base/
service/impl/utilsSve/utilsOrderSve.js/receiveCallBackNotify"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/receiveCallBackNotify"
,
content
:
JSON
.
stringify
(
parmas
),
content
:
JSON
.
stringify
(
parmas
),
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
...
@@ -389,7 +389,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -389,7 +389,7 @@ class UtilsOrderService extends AppServiceBase {
//日志记录
//日志记录
this
.
logCtl
.
info
({
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单参数:,method="
+
parmas
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单参数:,method="
+
parmas
.
trxcode
,
op
:
"
center-channel/app/base/
service/impl/utilsSve/utilsOrderSve.js/opBackNotify"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/opBackNotify"
,
content
:
JSON
.
stringify
(
parmas
),
content
:
JSON
.
stringify
(
parmas
),
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
...
@@ -406,13 +406,13 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -406,13 +406,13 @@ class UtilsOrderService extends AppServiceBase {
return
resultSign
;
return
resultSign
;
}
}
//获取充值业务锁
//获取充值业务锁
await
this
.
cacheManager
[
"TlPayLocker"
].
init
(
parmas
.
out_trade_no
);
//---测试时放开
//
await this.cacheManager["TlPayLocker"].init(parmas.out_trade_no);//---测试时放开
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
parmas
.
out_trade_no
);
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
parmas
.
out_trade_no
);
if
(
!
locker
||
locker
!=
"1"
)
{
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
this
.
logCtl
.
info
({
appid
:
appInfo
.
uapp_id
,
appid
:
appInfo
.
uapp_id
,
appkey
:
appInfo
.
uapp_key
,
appkey
:
appInfo
.
uapp_key
,
op
:
"
center-channel/app/base/
service/impl/utilsSve/utilsOrderSve.js/opBackNotify"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/opBackNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
clientIp
:
parmas
.
client_ip
||
""
,
clientIp
:
parmas
.
client_ip
||
""
,
optitle
:
"通联回调操作频繁---太频繁了,太频繁了"
optitle
:
"通联回调操作频繁---太频繁了,太频繁了"
...
@@ -462,7 +462,88 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -462,7 +462,88 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
}
}
async
opH5AliDingPayBackNotify
(
parmas
,
client_ip
)
{
//操作回调业务逻辑
try
{
//日志记录
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"阿里钉钉支付回调参数信息"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/opH5AliDingPayBackNotify"
,
content
:
JSON
.
stringify
(
parmas
),
clientIp
:
client_ip
||
""
});
if
(
!
parmas
.
trade_status
)
{
return
system
.
getResult
(
null
,
"trade_status参数不能为空,100470"
);
}
if
(
parmas
.
trade_status
!=
"TRADE_FINISHED"
&&
parmas
.
trade_status
!=
"TRADE_SUCCESS"
)
{
return
system
.
getResult
(
null
,
"trade_status状态有误,100473"
);
}
var
url
=
this
.
centerAppUrl
+
"payment/aliPayment/verifyAliPayReturnSign"
;
var
opResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opResult
.
status
!=
0
)
{
opResult
.
msg
=
opResult
.
msg
+
",100480"
;
return
opResult
;
}
// data:{
// orderNo: outTradeInfo[0],
// uappId: outTradeInfo[1],
// productId: outTradeInfo.length == 3 ? outTradeInfo[2] : 0
// }
opResult
.
data
=
{
orderNo
:
"TM36202004111014WcFs"
,
uappId
:
36
,
productId
:
42
};
//获取充值业务锁
await
this
.
cacheManager
[
"TlPayLocker"
].
init
(
opResult
.
data
.
orderNo
);
//---测试时放开
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
opResult
.
data
.
orderNo
);
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
opResult
.
data
.
uappId
,
appkey
:
""
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/opH5AliDingPayBackNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
),
clientIp
:
parmas
.
client_ip
||
""
,
optitle
:
"阿里回调操作频繁---太频繁了,太频繁了"
});
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
}
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
parmas
.
pay_type
=
"alipay"
;
//修改并返回订单支付状态,创建收款单
var
url
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotifyByAliDing"
;
var
opOrderResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opOrderResult
.
status
!=
0
)
{
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
opOrderResult
.
data
.
appInfo
=
{
uapp_id
:
opResult
.
data
.
uappId
};
opOrderResult
.
data
.
userInfo
=
{
channel_userid
:
opOrderResult
.
data
.
order_info
.
channelUserId
,
channel_username
:
opOrderResult
.
data
.
order_info
.
channelUserId
,
channel_nickname
:
opOrderResult
.
data
.
order_info
.
channelUserId
};
opOrderResult
.
data
.
orderNo
=
opResult
.
data
.
orderNo
;
var
pobj
=
{
appInfo
:
opOrderResult
.
data
.
appInfo
,
actionBody
:
opOrderResult
.
data
}
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"createAliTmApply"
,
1
);
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
parmas
.
out_trade_no
);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilstlbankSve.js/opBackNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
parmas
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
async
orderClose
(
pobj
)
{
//阿里退款
async
orderClose
(
pobj
)
{
//阿里退款
if
(
!
pobj
.
actionBody
.
orderNo
)
{
if
(
!
pobj
.
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.prderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.prderNo can not be empty"
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
View file @
fc8a297a
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//
商标查询操作
//
产品操作类
class
UtilsProductService
extends
AppServiceBase
{
class
UtilsProductService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
...
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
View file @
fc8a297a
...
@@ -5,7 +5,6 @@ const AppServiceBase = require("../../app.base");
...
@@ -5,7 +5,6 @@ const AppServiceBase = require("../../app.base");
class
UtilsPushService
extends
AppServiceBase
{
class
UtilsPushService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
};
};
async
aliBusiness2Fq
(
pobj
,
opType
)
{
//供业务调用,在代码中调用,不在db中做配置进行调用
async
aliBusiness2Fq
(
pobj
,
opType
)
{
//供业务调用,在代码中调用,不在db中做配置进行调用
...
@@ -16,7 +15,7 @@ class UtilsPushService extends AppServiceBase {
...
@@ -16,7 +15,7 @@ class UtilsPushService extends AppServiceBase {
this
.
pushBusInfo
(
pobj
,
opType
,
1
);
this
.
pushBusInfo
(
pobj
,
opType
,
1
);
}
}
async
pushBusInfo
(
pobj
,
opType
,
isDelProductInfo
)
{
//推送业务总入口
-包括重试
async
pushBusInfo
(
pobj
,
opType
,
isDelProductInfo
)
{
//推送业务总入口
var
interface_list
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
var
interface_list
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
if
(
!
interface_list
)
{
return
system
.
getResult
(
null
,
"暂无推送配置"
);
return
system
.
getResult
(
null
,
"暂无推送配置"
);
...
@@ -30,6 +29,19 @@ class UtilsPushService extends AppServiceBase {
...
@@ -30,6 +29,19 @@ class UtilsPushService extends AppServiceBase {
this
.
reflexAction
(
element
,
opType
,
pobj
,
isDelProductInfo
);
this
.
reflexAction
(
element
,
opType
,
pobj
,
isDelProductInfo
);
}
}
}
}
async
againPushBusInfo
(
pobj
)
{
//再次推送业务总入口-重试
var
interface_info
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_info
)
{
return
system
.
getResult
(
null
,
"暂无推送配置"
);
}
var
result
=
await
this
.
reflexAction
(
interface_info
,
pobj
.
opType
,
pobj
,
pobj
.
isDelProductInfo
||
1
);
if
(
result
.
status
!=
0
)
{
return
result
;
}
return
system
.
getResultSuccess
();
}
async
reflexAction
(
interface_info
,
opType
,
pobj
,
isDelProductInfo
)
{
async
reflexAction
(
interface_info
,
opType
,
pobj
,
isDelProductInfo
)
{
var
refResult
=
null
;
var
refResult
=
null
;
pobj
.
interface_info
=
interface_info
;
pobj
.
interface_info
=
interface_info
;
...
@@ -63,28 +75,12 @@ class UtilsPushService extends AppServiceBase {
...
@@ -63,28 +75,12 @@ class UtilsPushService extends AppServiceBase {
delete
actionBody
[
"product_info"
];
delete
actionBody
[
"product_info"
];
}
//是否删除产品信息进行推送
}
//是否删除产品信息进行推送
refResult
=
await
this
.
restPostUrl
(
pobj
.
actionBody
,
interface_info
.
interface_url
);
refResult
=
await
this
.
restPostUrl
(
pobj
.
actionBody
,
interface_info
.
interface_url
);
this
.
disposePushResult
(
pobj
,
refResult
,
"ycUrlPush->reflexAction->refResult"
);
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
op
:
JSON
.
stringify
(
pobj
.
interface_info
),
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
rtn
),
returnType
:
refResult
.
status
==
0
?
'1'
:
'0'
,
opTitle
:
opType
+
(
refResult
.
status
==
0
?
"数据推送成功->reflexAction"
:
"数据推送出错->reflexAction"
)
});
}
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
pushlogSve
.
createDb
({
var
errorResult
=
system
.
getResult
(
null
,
"送异常-->reflexAction->"
+
e
.
stack
)
appid
:
pobj
.
appInfo
.
uapp_id
,
return
await
this
.
disposePushResultFail
(
pobj
,
errorResult
,
"数据推送异常-->reflexAction-->errorResult"
);
appkey
:
pobj
.
appInfo
.
uapp_key
,
op
:
JSON
.
stringify
(
pobj
.
interface_info
),
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
""
,
returnType
:
'0'
,
opTitle
:
opType
+
"数据推送异常-->reflexAction"
});
}
}
}
}
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsTmAliyunSve.js
View file @
fc8a297a
This diff is collapsed.
Click to expand it.
center-channel/app/base/utils/aliyunClient.js
View file @
fc8a297a
...
@@ -30,6 +30,9 @@ class aliyunClient {
...
@@ -30,6 +30,9 @@ class aliyunClient {
var
action
=
obj
.
action
;
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
var
reqbody
=
obj
.
reqbody
;
try
{
try
{
if
(
obj
.
apiVersion
)
{
this
.
aliclient
.
apiVersion
=
obj
.
apiVersion
;
}
var
res
=
await
this
.
aliclient
.
request
(
action
,
reqbody
,
{
var
res
=
await
this
.
aliclient
.
request
(
action
,
reqbody
,
{
timeout
:
3000
,
// default 3000 ms
timeout
:
3000
,
// default 3000 ms
formatAction
:
true
,
// default true, format the action to Action
formatAction
:
true
,
// default true, format the action to Action
...
@@ -38,8 +41,8 @@ class aliyunClient {
...
@@ -38,8 +41,8 @@ class aliyunClient {
headers
:
{},
// set the http request headers
headers
:
{},
// set the http request headers
});
});
this
.
pushlogSve
.
createDb
({
this
.
pushlogSve
.
createDb
({
op
:
"
推送阿里信息返回:"
+
action
,
op
:
"
old-reqbyget"
,
content
:
JSON
.
stringify
(
obj
),
content
:
JSON
.
stringify
(
obj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
res
),
resultInfo
:
JSON
.
stringify
(
res
),
returnType
:
'1'
,
returnType
:
'1'
,
logLevel
:
'1'
,
logLevel
:
'1'
,
...
@@ -47,13 +50,16 @@ class aliyunClient {
...
@@ -47,13 +50,16 @@ class aliyunClient {
});
});
return
system
.
getResultSuccess
(
res
);
return
system
.
getResultSuccess
(
res
);
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
pushlogSve
.
createDb
({
this
.
pushlogSve
.
createFailLogDb
({
op
:
"推送阿里信息返回:"
+
action
,
appid
:
obj
.
appInfo
?
obj
.
appInfo
.
uapp_id
||
""
:
""
,
content
:
JSON
.
stringify
(
obj
),
appkey
:
obj
.
appInfo
?
obj
.
appInfo
.
uapp_key
||
""
:
""
,
resultInfo
:
JSON
.
stringify
(
e
.
stack
),
requestId
:
obj
.
requestId
||
""
,
returnType
:
'0'
,
content
:
JSON
.
stringify
(
obj
),
//推送的参数信息
logLevel
:
'3'
,
resultInfo
:
"error:"
+
JSON
.
stringify
(
e
.
stack
),
opTitle
:
"old-reqbyget推送阿里信息返回异常"
clientIp
:
obj
.
clientIp
||
""
,
failType
:
1
,
opTitle
:
"old-reqbyget推送阿里信息返回异常"
,
pushNumber
:
obj
.
pushNumber
||
1
});
});
return
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
return
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
}
}
...
@@ -75,20 +81,39 @@ class aliyunClient {
...
@@ -75,20 +81,39 @@ class aliyunClient {
if
(
rpcParam
.
apiVersion
)
{
if
(
rpcParam
.
apiVersion
)
{
this
.
aliclient
.
apiVersion
=
rpcParam
.
apiVersion
;
this
.
aliclient
.
apiVersion
=
rpcParam
.
apiVersion
;
}
}
try
{
var
res
=
await
this
.
aliclient
.
request
(
action
,
reqbody
,
{
var
res
=
await
this
.
aliclient
.
request
(
action
,
reqbody
,
{
timeout
:
3000
,
// default 3000 ms
timeout
:
3000
,
// default 3000 ms
formatAction
:
true
,
// default true, format the action to Action
formatAction
:
true
,
// default true, format the action to Action
formatParams
:
true
,
// default true, format the parameter name to first letter upper case
formatParams
:
true
,
// default true, format the parameter name to first letter upper case
method
:
'GET'
,
// set the http method, default is GET
method
:
'GET'
,
// set the http method, default is GET
headers
:
{},
// set the http request headers
headers
:
{},
// set the http request headers
});
});
return
system
.
getResultSuccess
(
res
);
return
system
.
getResultSuccess
(
res
);
}
}
catch
(
e
)
{
async
reqCustomByPost
(
obj
,
cbk
)
{
return
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
var
rpcParam
=
obj
.
rpcParam
;
if
(
rpcParam
.
accessKeyId
)
{
this
.
aliclient
.
accessKeyId
=
rpcParam
.
accessKeyId
;
}
}
if
(
rpcParam
.
accessKeySecret
)
{
this
.
aliclient
.
accessKeySecret
=
rpcParam
.
accessKeySecret
;
}
if
(
rpcParam
.
endpoint
)
{
this
.
aliclient
.
endpoint
=
rpcParam
.
endpoint
;
}
if
(
rpcParam
.
apiVersion
)
{
this
.
aliclient
.
apiVersion
=
rpcParam
.
apiVersion
;
}
var
res
=
await
this
.
aliclient
.
request
(
action
,
reqbody
,
{
timeout
:
3000
,
// default 3000 ms
formatAction
:
true
,
// default true, format the action to Action
formatParams
:
true
,
// default true, format the parameter name to first letter upper case
method
:
'POST'
,
// set the http method, default is GET
headers
:
{},
// set the http request headers
});
return
system
.
getResultSuccess
(
res
);
}
}
}
}
module
.
exports
=
aliyunClient
;
module
.
exports
=
aliyunClient
;
center-channel/app/base/utils/businessManager/pushUtils.js
View file @
fc8a297a
...
@@ -5,9 +5,7 @@ const md5 = require("MD5");
...
@@ -5,9 +5,7 @@ const md5 = require("MD5");
class
PushUtils
{
class
PushUtils
{
constructor
()
{
constructor
()
{
this
.
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
this
.
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
this
.
merchantpushlogSve
=
system
.
getObject
(
"service.merchant.merchantpushlogSve"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
merchantpushSve
=
system
.
getObject
(
"service.merchant.merchantpushSve"
);
}
}
getUUID
()
{
getUUID
()
{
var
uuid
=
uuidv4
();
var
uuid
=
uuidv4
();
...
@@ -19,53 +17,7 @@ class PushUtils {
...
@@ -19,53 +17,7 @@ class PushUtils {
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
return
await
cacheManager
[
"MerchantPushUrlCache"
].
cache
(
merchant_id
,
null
,
3600
);
return
await
cacheManager
[
"MerchantPushUrlCache"
].
cache
(
merchant_id
,
null
,
3600
);
}
}
/**
* 推送到第三方数据
* @param {*} reqUrl 请求推送的url
* @param {*} params 推送的参数
*/
async
push
(
merchantId
,
field
,
params
)
{
try
{
var
pushConfig
=
await
this
.
getCachePushItemUrl
(
merchantId
)
||
{};
var
reqUrl
=
pushConfig
[
field
];
if
(
!
reqUrl
)
{
this
.
logCtl
.
error
({
optitle
:
"推送到第三方数据异常error"
,
op
:
"merchantId = "
+
merchantId
+
"; reqUrl is empty, field = "
+
field
,
content
:
"reqUrl is empty"
,
clientIp
:
"pushUtils中没有ip"
});
return
;
}
// 签名
params
.
sign
=
await
this
.
createSign
(
params
,
merchantId
);
params
.
requestid
=
this
.
getUUID
();
var
rtn
=
await
this
.
execClient
.
execPost
(
params
,
reqUrl
);
var
returnValue
=
0
;
if
(
rtn
.
stdout
)
{
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
code
==
"success"
)
{
returnValue
=
1
;
}
}
//记录推送结果
this
.
merchantpushlogSve
.
create
({
merchant_id
:
merchantId
,
//商户id
api
:
reqUrl
,
//接口地址
params
:
JSON
.
stringify
(
params
),
//推送数据信息
rs
:
rtn
.
stdout
,
//推送返回结果
success
:
returnValue
//是否推送成功
});
}
catch
(
e
)
{
console
.
log
(
e
.
stack
);
this
.
logCtl
.
error
({
optitle
:
"推送到第三方数据异常error"
,
op
:
reqUrl
+
";params="
+
JSON
.
stringify
(
params
)
+
";reqid="
+
params
.
requestid
,
content
:
e
.
stack
,
clientIp
:
"pushUtils中没有ip"
});
}
}
/**
/**
* 多次推送到第三方数据
* 多次推送到第三方数据
* @param {*} reqUrl 请求推送的url
* @param {*} reqUrl 请求推送的url
...
@@ -102,10 +54,10 @@ class PushUtils {
...
@@ -102,10 +54,10 @@ class PushUtils {
var
keys
=
Object
.
keys
(
params
).
sort
();
var
keys
=
Object
.
keys
(
params
).
sort
();
for
(
let
k
=
0
;
k
<
keys
.
length
;
k
++
)
{
for
(
let
k
=
0
;
k
<
keys
.
length
;
k
++
)
{
const
tKey
=
keys
[
k
];
const
tKey
=
keys
[
k
];
if
(
tKey
!=
"sign"
&&
params
[
tKey
])
{
if
(
tKey
!=
"sign"
&&
params
[
tKey
])
{
signArr
.
push
(
tKey
+
"="
+
params
[
tKey
]);
signArr
.
push
(
tKey
+
"="
+
params
[
tKey
]);
}
}
}
}
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
appInfo
.
appSecret
;
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
appInfo
.
appSecret
;
return
md5
(
resultSignStr
).
toUpperCase
();
return
md5
(
resultSignStr
).
toUpperCase
();
...
...
center-channel/app/config/routes/api.js
View file @
fc8a297a
...
@@ -10,22 +10,22 @@ module.exports = function (app) {
...
@@ -10,22 +10,22 @@ module.exports = function (app) {
app
.
use
(
'/tlpay/aliPayNotify'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/tlpay/aliPayNotify'
,
async
function
(
req
,
res
)
{
try
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
// var result = await utilsOrderSve.receiveCall
BackNotify(req.body, client_ip);
var
result
=
await
utilsOrderSve
.
opH5AliDingPay
BackNotify
(
req
.
body
,
client_ip
);
logCtl
.
info
({
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"
aliPayNotify记录回调
"
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"
记录阿里钉钉支付回调处理结果
"
,
op
:
"center-channel/tlpay/aliPayNotify"
,
op
:
"center-channel/tlpay/aliPayNotify"
,
content
:
"
回调参数:"
+
JSON
.
stringify
(
req
.
body
),
content
:
"
支付回调处理结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
//
if (result.status != 0) {
if
(
result
.
status
!=
0
)
{
//
return res.end("FAIL");
return
res
.
end
(
"FAIL"
);
//
}
}
return
res
.
end
(
"success"
);
return
res
.
end
(
"success"
);
}
catch
(
error
)
{
}
catch
(
error
)
{
logCtl
.
error
({
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"
aliPayNotify记录回调
异常"
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"
阿里钉钉支付回调处理
异常"
,
op
:
"center-channel/tlpay/aliPayNotify"
,
op
:
"center-channel/tlpay/aliPayNotify"
,
content
:
"回调参数:
"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
content
:
"回调参数:
req="
+
JSON
.
stringify
(
req
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
}
}
...
@@ -109,7 +109,8 @@ module.exports = function (app) {
...
@@ -109,7 +109,8 @@ module.exports = function (app) {
}
}
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
var
lst
=
[
"tmConfirm"
,
var
lst
=
[
"tmConfirm"
,
"getNeedSolutionDetailByUser"
,
"submitIcpProgramme"
,
"submitIcpMaterial"
,
"acceptIcpPartnerNotification"
,
"abolishIcpProgramme"
,
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"getOrderDetails"
,
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"getOrderDetails"
,
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"delOrder"
,
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"delOrder"
,
"submitProgramme"
,
"getProgrammeListByUser"
,
"getProgrammeInfoByNeedNo"
,
"abolishProgramme"
,
"getAliPayInfo"
"submitProgramme"
,
"getProgrammeListByUser"
,
"getProgrammeInfoByNeedNo"
,
"abolishProgramme"
,
"getAliPayInfo"
...
...
center-channel/app/config/settings.js
View file @
fc8a297a
...
@@ -20,6 +20,13 @@ var settings = {
...
@@ -20,6 +20,13 @@ var settings = {
usertimeout
:
3600
,
//单位秒
usertimeout
:
3600
,
//单位秒
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
4012
,
port
:
process
.
env
.
NODE_PORT
||
4012
,
aliossjavaUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.0.104:8080/uploadfile"
;
}
else
{
return
"http://aliossjava-service/uploadfile"
;
}
},
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"
;
...
...
center-channel/app/front/entry/public/apidoc/README.md
View file @
fc8a297a
...
@@ -41,4 +41,7 @@
...
@@ -41,4 +41,7 @@
1
[
工商订单接口
](
doc/api/platform/icbcOrder.md
)
1
[
工商订单接口
](
doc/api/platform/icbcOrder.md
)
## 11. 政策相关接口
## 11. 政策相关接口
1
[
政策接口
](
doc/api/platform/policy.md
)
1
[
政策接口
](
doc/api/platform/policy.md
)
\ No newline at end of file
## 12. ICP订单相关接口
1
[
ICP订单接口
](
doc/api/platform/icpOrder.md
)
\ No newline at end of file
center-channel/app/front/entry/public/apidoc/platform/icpOrder.md
0 → 100644
View file @
fc8a297a
<a
name=
"menu"
href=
"/doc"
>
返回主目录
</a>
1.
[
icp方案提交
](
#submitIcpProgramme
)
1.
[
icp材料提交
](
#submitIcpMaterial
)
1.
[
根据需求产看方案详情
](
#getProgrammeInfoByNeedNo
)
1.
[
icp通知状态变更
](
#acceptIcpPartnerNotification
)
1.
[
服务商关闭icp方案
](
#abolishIcpProgramme
)
1.
[
获取方案详情
](
#getNeedSolutionDetailByUser
)
## **<a name="submitIcpProgramme"> icp方案提交</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/action/icpapi/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:submitIcpProgramme
```
javascript
{
"actionType"
:
"submitIcpProgramme"
,
"actionBody"
:{
"needNo"
:
"I20200320201737000zhb"
,
"solutionContent"
:{
"bizType"
:
"gszc"
,
"solution"
:{
"CompanyName"
:
"公司名"
,
"CompanyAddress"
:
"公司地址"
,
"Area"
:
"区域"
,
"Note"
:
"备注"
}
}
}
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
// 0为成功,否则失败
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"a277fb799d9f4dda9053fb8830f9d252"
}
```
## **<a name="submitIcpMaterial"> icp材料提交</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/action/icpapi/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:submitIcpMaterial
```
javascript
{
"actionType"
:
"submitIcpMaterial"
,
"actionBody"
:{
"BizId"
:
"S20200323174838000zhb"
,
"material"
:{
"Domain"
:
"备案域名"
,
"CorporateName"
:
"法人名称"
,
"IncludeForeignInvestment"
:
true
,
"PartnerBusinessLicense"
:
"营业执照"
,
"PartnerIdCardList"
:[
"相关人员身份证"
],
"PartnerDomainCertificate"
:
"域名证书"
,
"PartnerPreviewOtherList"
:[
"合作方递交其他供预览的件,只能传递ZIP包"
],
"PartnerPlan"
:
"收费方案计划书"
,
"PartnerForeignInvestment"
:
"股东追溯不涉及外资承诺书"
,
"PartnerLaw"
:
"依法经营电信业务承诺书"
,
"PartnerStampOtherList"
:[
"需要盖章,只能传递1个zip包"
],
"PartnerSignOtherList"
:[
"需要签字,只能传递1个zip包"
],
"PartnerSignAndStampOtherList"
:[
"需要盖章,只能传递1个zip包"
]
}
}
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
// 0为成功,否则失败
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"a277fb799d9f4dda9053fb8830f9d252"
}
```
## **<a name="getProgrammeInfoByNeedNo"> 根据需求产看方案详情</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/action/icapi/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:getProgrammeInfoByNeedNo
```
javascript
{
"actionType"
:
"getProgrammeInfoByNeedNo"
,
"actionBody"
:{
"needNo"
:
"N202002141324bupnr8L"
}
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:[
{
"needNo"
:
"N202002141324bupnr8L"
,
"solutionNo"
:
"NS202003161734ay0SzH"
,
"orderNo"
:
null
,
"solutionContent"
:{
"bizType"
:
"esp.companyreg"
,
"notes"
:
"用户反馈"
,
"solution"
:{
}
},
"status"
:
"yzf"
,
"statusName"
:
"已作废"
}
],
"requestId"
:
"4302ecc284e747a990e4ad61d8236b60"
}
```
## **<a name="acceptIcpPartnerNotification"> icp通知状态变更</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/action/icapi/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:acceptIcpPartnerNotification
```
javascript
{
"actionType"
:
"acceptIcpPartnerNotification"
,
"actionBody"
:{
"BizId"
:
"S20200323174838000zhb"
,
"OfficialFileUrl"
:
"官⽂下载地址"
,
"ApplicationStatus"
:
"507"
}
}
ApplicationStatus
:
507
,
"完成账户注册"
508
,
"服务商完成提交资料到⼯信部"
509
,
"⼯商部已受理"
,可以传递发⽂
510
,
"⼯商部不予受理"
,可以传递发⽂
511
,
"⼯商部通过"
,可以传递发⽂
512
,
"⼯商部未通过"
,可以传递发⽂
```
#### 返回结果
```
javascript
{
"status"
:
0
,
// 0为成功,否则失败
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"a277fb799d9f4dda9053fb8830f9d252"
}
```
## **<a name="abolishIcpProgramme"> 服务商关闭icp方案</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/action/icapi/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:abolishIcpProgramme
```
javascript
{
"actionType"
:
"abolishIcpProgramme"
,
"actionBody"
:{
"BizId"
:
"S20200323174838000zhb"
,
"Note"
:
"备注"
}
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"40769e74e83f4505a78b24d84fed870b"
}
```
## **<a name="getNeedSolutionDetailByUser"> 获取方案详情</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/action/icapi/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:getNeedSolutionDetailByUser
```
javascript
{
"actionType"
:
"getNeedSolutionDetailByUser"
,
"actionBody"
:{
"solutionNo"
:
"NS202004131008iKPRDB"
}
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:[
{
"id"
:
230
,
"channelNeedNo"
:
"I20200320201737000221"
,
//渠道需求号
"needNo"
:
"N202004111217gD5T8TJ"
,
//需求号
"solutionNo"
:
"NS202004131349EAWwSV"
,
//方案号
"channelSolutionNo"
:
"S20200323174838000zhb7"
,
//渠道方案号 同BizId
"orderNo"
:
null
,
//服务订单号
"solutionContent"
:{
//方案交付信息
"notes"
:
""
,
//用户反馈备注
"status"
:
"ACCOUNT_REGISTERED"
,
//方案流程状态
"bizType"
:
"icpsq"
,
//操作类型
"material"
:{
//材料信息
"Domain"
:
"备案域名"
,
"PartnerLaw"
:
"依法经营电信业务承诺书"
,
"PartnerPlan"
:
"收费方案计划书"
,
"CorporateName"
:
"法人名称"
,
"PartnerIdCardList"
:[
"相关人员身份证"
],
"PartnerSignOtherList"
:[
"需要签字,只能传递1个zip包"
],
"PartnerStampOtherList"
:[
"需要盖章,只能传递1个zip包"
],
"PartnerBusinessLicense"
:
"营业执照"
,
"PartnerPreviewOtherList"
:[
"合作方递交其他供预览的件,只能传递ZIP包"
],
"IncludeForeignInvestment"
:
true
,
"PartnerDomainCertificate"
:
"域名证书"
,
"PartnerForeignInvestment"
:
"股东追溯不涉及外资承诺书"
,
"PartnerSignAndStampOtherList"
:[
"需要盖章,只能传递1个zip包"
]
},
"solution"
:{
//方案信息
"Area"
:
"区域222"
,
"Note"
:
"备注222"
,
"IcpType"
:
"icp"
,
"CompanyName"
:
"公司名测试数据222"
,
"CompanyAddress"
:
"公司地址222"
},
"totalSum"
:
""
,
//订单金额
"typeCode"
:
"icpsq"
,
//产品码
"typeName"
:
"icp申请"
,
//产品名称
"statusName"
:
"完成账户注册"
,
//流程状态名称
"solutionFlowList"
:[
//方案流程列表
{
"status"
:
"ACCOUNT_REGISTERED"
,
"statusName"
:
"完成账户注册"
,
"updated_at"
:
"2020-04-13T05:51:08.790Z"
}
],
"applicationStatusList"
:[
//方案通知状态列表 ---- 未用到
{
"created_at"
:
"2020-04-13T05:49:19.750Z"
,
"OfficialFileURL"
:
""
,
"ApplicationStatus"
:
"submitIcpProgramme"
,
"ApplicationStatusName"
:
"提交方案"
},
{
"created_at"
:
"2020-04-13T05:51:08.790Z"
,
"OfficialFileURL"
:
""
,
"ApplicationStatus"
:
"507"
,
"ApplicationStatusName"
:
"507"
}
]
},
"status"
:
"dqr"
,
//方案状态
"statusName"
:
"待确认"
,
//方案状态
"createUserId"
:
100
,
"created_at"
:
"2020-04-13T05:49:19.000Z"
,
"updated_at"
:
"2020-04-13T05:51:08.000Z"
,
"deleted_at"
:
null
,
"version"
:
0
}
],
"requestId"
:
"1594aa8fabfd42eba332160263b2597e"
}
```
center-channel/提示编码使用
View file @
fc8a297a
已经使用的
编码汇总:
已经使用的
编码汇总:
...
@@ -42,4 +42,11 @@
...
@@ -42,4 +42,11 @@
100410
100410
100420
100420
100430
100430
100440
100440
\ No newline at end of file
100450
100460
100470
100480
100490
100500
100510
\ 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