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
2ad4065d
Commit
2ad4065d
authored
Mar 25, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
d0892f31
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
24 deletions
+47
-24
center-channel/.gitignore
+4
-0
center-channel/app/base/api/api.base.js
+1
-1
center-channel/app/base/api/impl/opaction/order.js
+31
-12
center-channel/app/base/api/web.base.js
+11
-11
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+0
-0
No files found.
center-channel/.gitignore
View file @
2ad4065d
node_modules/
.idea
.history/
.vscode
\ No newline at end of file
center-channel/app/base/api/api.base.js
View file @
2ad4065d
...
...
@@ -53,7 +53,7 @@ class APIBase {
await
this
.
redisClient
.
setWithEx
(
shaStr
,
JSON
.
stringify
(
result
),
3600
);
}
var
tmpResult
=
pobj
.
actionType
&&
pobj
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
this
.
execClientNew
.
execLogs
(
"center-channel-doexecMethod-reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod"
,
tmpResult
,
null
);
this
.
execClientNew
.
execLogs
(
"
api-
center-channel-doexecMethod-reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod"
,
tmpResult
,
null
);
return
result
;
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
...
...
center-channel/app/base/api/impl/opaction/order.js
View file @
2ad4065d
var
WEBBase
=
require
(
"../../web.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
ProductAPI
extends
WEBBase
{
constructor
()
{
super
();
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess参数不能为空"
);
...
...
@@ -22,15 +24,19 @@ class ProductAPI extends WEBBase {
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
pobj
.
requestId
=
req
.
requestId
;
var
opResult
=
null
;
switch
(
action_type
)
{
case
"addOrder"
:
//创建订单
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
//处理推送到峰擎
// opType:值为query、add
this
.
pushNewFq
(
pobj
,
opResult
);
break
;
case
"addOrderWeb"
:
//创建订单 官网
opResult
=
await
this
.
utilsOrderSve
.
addOrderWeb
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
addOrderWeb
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getOrderInfo"
:
//获取订单列表信息
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
...
...
@@ -69,22 +75,22 @@ class ProductAPI extends WEBBase {
// opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
// break;
case
"addUsuallyContacts"
:
//添加常用联系人、申请人
opResult
=
await
this
.
utilsOrderSve
.
addUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
addUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
break
;
case
"delUsuallyContacts"
:
//删除常用联系人、申请人
opResult
=
await
this
.
utilsOrderSve
.
delUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
delUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
break
;
case
"updateUsuallyContacts"
:
//修改常用联系人、申请人
opResult
=
await
this
.
utilsOrderSve
.
updateUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
updateUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getUsuallyContacts"
:
//查询常用联系人、申请人
opResult
=
await
this
.
utilsOrderSve
.
getUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
getUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
break
;
case
"importOrders"
:
opResult
=
await
this
.
utilsOrderSve
.
importOrders
(
pobj
,
req
);
opResult
=
await
this
.
utilsOrderSve
.
importOrders
(
pobj
,
req
);
break
;
case
"pushTest"
:
opResult
=
await
this
.
utilsOrderSve
.
pushTest
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
pushTest
(
pobj
,
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
@@ -93,5 +99,18 @@ class ProductAPI extends WEBBase {
return
opResult
;
}
async
pushNewFq
(
pobj
,
result
)
{
if
(
result
.
status
==
0
&&
result
.
data
&&
result
.
data
.
channelOrderNo
)
{
try
{
pobj
.
actionType
=
"getOrderInfoByChannelOrderNo"
;
pobj
.
actionBody
.
channelOrderNo
=
result
.
data
.
channelOrderNo
;
await
this
.
utilsOrderSve
.
pushNewFqByChannelOrderNo
(
pobj
);
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
this
.
execClientNew
.
execLogs
(
"pushNewFq异常:"
,
pobj
,
"center-channel-pushNewFq"
,
null
,
stackStr
);
}
}
}
}
module
.
exports
=
ProductAPI
;
center-channel/app/base/api/web.base.js
View file @
2ad4065d
...
...
@@ -38,7 +38,7 @@ class WEBBase {
opTitle
:
"api服务提供方appKey:"
+
settings
.
appKey
,
});
var
tmpResult
=
pobj
.
actionType
&&
pobj
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
this
.
execClientNew
.
execLogs
(
"reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod-web"
,
tmpResult
,
null
);
this
.
execClientNew
.
execLogs
(
"
web-center-channel--
reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod-web"
,
tmpResult
,
null
);
return
result
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"api调用出现异常,请联系管理员.........."
)
...
...
@@ -53,16 +53,16 @@ class WEBBase {
agent
:
req
.
uagent
,
opTitle
:
"api调用出现异常,请联系管理员error,appKey:"
+
settings
.
appKey
,
});
this
.
logCtl
.
error
({
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
,
op
:
req
.
classname
+
"/"
+
methodname
,
content
:
e
.
stack
,
clientIp
:
pobj
.
clientIp
,
agent
:
req
.
uagent
,
optitle
:
"api调用出现异常,请联系管理员"
,
});
//
this.logCtl.error({
//
appid: req.app.id,
//
appkey: req.app.uappKey,
//
requestId: req.requestId,
//
op: req.classname + "/" + methodname,
//
content: e.stack,
//
clientIp: pobj.clientIp,
//
agent: req.uagent,
//
optitle: "api调用出现异常,请联系管理员",
//
});
var
rtnerror
=
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
rtnerror
.
requestId
=
req
.
requestId
;
return
rtnerror
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
2ad4065d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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