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
c13cd61c
Commit
c13cd61c
authored
Jun 09, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orderPrice
parent
8957a52f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
246 additions
and
88 deletions
+246
-88
igirl-channel-gateway/app/base/service/impl/common/gatewaypushlogSve.js
+84
-13
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
+3
-0
igirl-channel-gateway/app/config/routes/api.js
+159
-75
No files found.
igirl-channel-gateway/app/base/service/impl/common/gatewaypushlogSve.js
View file @
c13cd61c
...
@@ -107,41 +107,41 @@ class GatewaypushlogService extends ServiceBase {
...
@@ -107,41 +107,41 @@ class GatewaypushlogService extends ServiceBase {
}
}
//支付回调
//支付回调
async
paySuccess
(
pobj
)
{
async
paySuccess
(
pobj
)
{
var
self
=
this
;
var
self
=
this
;
if
(
!
pobj
.
orderNo
)
{
if
(
!
pobj
.
orderNo
)
{
return
{
"message"
:
"orderNo不能为空"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"orderNo不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
if
(
!
pobj
.
orderPrice
)
{
pobj
.
orderPrice
=
Number
(
pobj
.
orderPrice
||
"0"
);
return
{
"message"
:
"orderPrice不能为空"
,
"data"
:{},
"code"
:
-
200
};
if
(
pobj
.
orderPrice
<
0
)
{
return
{
"message"
:
"orderPrice不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
if
(
!
pobj
.
phone
)
{
if
(
!
pobj
.
phone
)
{
return
{
"message"
:
"phone不能为空"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"phone不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
if
(
pobj
.
companyName
)
{
if
(
pobj
.
companyName
)
{
if
(
!
pobj
.
city
)
{
if
(
!
pobj
.
city
)
{
return
{
"message"
:
"city不能为空"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"city不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
if
(
!
pobj
.
companyCategory
)
{
if
(
!
pobj
.
companyCategory
)
{
return
{
"message"
:
"companyCategory不能为空"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"companyCategory不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
if
(
!
pobj
.
orgType
)
{
if
(
!
pobj
.
orgType
)
{
return
{
"message"
:
"orgType不能为空"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"orgType不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
if
(
!
pobj
.
industryType
)
{
if
(
!
pobj
.
industryType
)
{
return
{
"message"
:
"industryType不能为空"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"industryType不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
if
(
!
pobj
.
scope
)
{
if
(
!
pobj
.
scope
)
{
return
{
"message"
:
"scope不能为空"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"scope不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
}
else
if
(
pobj
.
park
)
{
}
else
if
(
pobj
.
park
)
{
if
(
!
pobj
.
productType
)
{
if
(
!
pobj
.
productType
)
{
return
{
"message"
:
"productType不能为空"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"productType不能为空"
,
"data"
:
{},
"code"
:
-
200
};
}
}
}
else
{
}
else
{
return
{
"message"
:
"参数异常"
,
"data"
:{},
"code"
:
-
200
};
return
{
"message"
:
"参数异常"
,
"data"
:
{},
"code"
:
-
200
};
}
}
var
param
=
{
var
param
=
{
requestId
:
self
.
getUUID
(),
requestId
:
self
.
getUUID
(),
...
@@ -153,11 +153,82 @@ class GatewaypushlogService extends ServiceBase {
...
@@ -153,11 +153,82 @@ class GatewaypushlogService extends ServiceBase {
pushStatus
:
"wts"
,
//推送状态
pushStatus
:
"wts"
,
//推送状态
}
}
await
this
.
create
(
param
);
await
this
.
create
(
param
);
return
{
"message"
:
"true"
,
"data"
:{},
"code"
:
200
};
return
{
"message"
:
"true"
,
"data"
:
{},
"code"
:
200
};
}
}
//icp需求提交
async
icpSubmitNeed
(
pobj
)
{
var
self
=
this
;
if
(
!
pobj
.
intentionBizId
)
{
return
self
.
getResultFail
(
"intentionBizId不能为空"
);
}
if
(
!
pobj
.
phone
)
{
return
self
.
getResultFail
(
"mobile不能为空"
);
}
if
(
!
pobj
.
consultType
)
{
return
self
.
getResultFail
(
"consultType不能为空"
);
}
pobj
.
type
=
pobj
.
consultType
;
var
param
=
{
requestId
:
self
.
getUUID
(),
requestUrl
:
"/api/ali/tm/consultation/submit"
,
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/queryOrderState"
,
//调用地址
pushActionType
:
"icpSubmitNeed"
,
//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
}
await
self
.
create
(
param
);
return
self
.
getResultSuccess
(
param
.
requestId
);
}
//icp需求反馈
async
icpFeedbackSubmit
(
pobj
)
{
var
self
=
this
;
if
(
!
pobj
.
intentionBizId
)
{
return
self
.
getResultFail
(
"intentionBizId不能为空"
);
}
if
(
!
pobj
.
description
)
{
return
self
.
getResultFail
(
"description不能为空"
);
}
if
(
!
pobj
.
intentionStatus
)
{
return
self
.
getResultFail
(
"intentionStatus不能为空"
);
}
var
param
=
{
requestId
:
self
.
getUUID
(),
requestUrl
:
"/api/ali/tm/feedback/submit"
,
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/queryOrderState"
,
//调用地址
pushActionType
:
"icpFeedbackSubmit"
,
//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
}
await
self
.
create
(
param
);
return
self
.
getResultSuccess
(
param
.
requestId
);
}
//icp状态变更
async
icpNotify
(
pobj
)
{
var
self
=
this
;
if
(
!
pobj
.
bizId
)
{
return
self
.
getResultFail
(
"bizId不能为空"
);
}
if
(
!
pobj
.
status
)
{
return
self
.
getResultFail
(
"status不能为空"
);
}
var
param
=
{
requestId
:
self
.
getUUID
(),
requestUrl
:
"/api/ali/tm/feedback/submit"
,
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/queryOrderState"
,
//调用地址
pushActionType
:
"icpNotify"
,
//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
}
await
self
.
create
(
param
);
return
self
.
getResultSuccess
(
param
.
requestId
);
}
}
}
...
...
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
c13cd61c
...
@@ -60,6 +60,9 @@ class UtilsNeedSve extends AppServiceBase {
...
@@ -60,6 +60,9 @@ class UtilsNeedSve extends AppServiceBase {
};
};
}
}
var
userpin
=
""
;
var
userpin
=
""
;
if
(
pobj
.
phone
&&!
pobj
.
mobile
){
pobj
.
mobile
=
pobj
.
phone
;
}
if
(
pobj
.
mobile
)
{
if
(
pobj
.
mobile
)
{
//获取用户userpin
//获取用户userpin
var
userparam
=
{
var
userparam
=
{
...
...
igirl-channel-gateway/app/config/routes/api.js
View file @
c13cd61c
...
@@ -9,8 +9,8 @@ module.exports = function (app) {
...
@@ -9,8 +9,8 @@ module.exports = function (app) {
app
.
use
(
'/api/ali/esp/intention/submit'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/api/ali/esp/intention/submit'
,
async
function
(
req
,
res
)
{
try
{
try
{
console
.
log
(
req
.
headers
[
'content-type'
])
console
.
log
(
req
.
headers
[
'content-type'
])
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>
-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
}
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
...
@@ -36,7 +36,7 @@ module.exports = function (app) {
...
@@ -36,7 +36,7 @@ module.exports = function (app) {
});
});
app
.
use
(
'/api/ali/esp/intention/solution/feedback'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/api/ali/esp/intention/solution/feedback'
,
async
function
(
req
,
res
)
{
try
{
try
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>
-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
}
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
...
@@ -61,7 +61,7 @@ module.exports = function (app) {
...
@@ -61,7 +61,7 @@ module.exports = function (app) {
});
});
app
.
use
(
'/api/ali/ic/paySuccess'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/api/ali/ic/paySuccess'
,
async
function
(
req
,
res
)
{
try
{
try
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>
-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
}
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
...
@@ -86,7 +86,7 @@ module.exports = function (app) {
...
@@ -86,7 +86,7 @@ module.exports = function (app) {
});
});
app
.
use
(
'/api/ali/ic/close'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/api/ali/ic/close'
,
async
function
(
req
,
res
)
{
try
{
try
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>
-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
}
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
...
@@ -111,7 +111,7 @@ module.exports = function (app) {
...
@@ -111,7 +111,7 @@ module.exports = function (app) {
});
});
app
.
use
(
'/api/ali/esp/intention/close'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/api/ali/esp/intention/close'
,
async
function
(
req
,
res
)
{
try
{
try
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>
-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
}
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
...
@@ -136,19 +136,148 @@ module.exports = function (app) {
...
@@ -136,19 +136,148 @@ module.exports = function (app) {
});
});
//test
// //test
app
.
use
(
'/api/alitest/esp/intention/submit'
,
async
function
(
req
,
res
)
{
// app.use('/api/alitest/esp/intention/submit', async function (req, res) {
// try {
// console.log(req.headers['content-type'])
// if (req.headers['content-type'].indexOf('application/octet-stream')>-1 ) {
// await logCtl.applicationOctetStream2Json(req);
// }
// var client_ip = system.get_client_ip(req);
// req.body.action_type = "submitNeed";
// var result = await utilsNeedSve.reqcenterchannel(req.body, client_ip);
// logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "回调处理订单结果:,method=" + req.body.trxcode,
// op: "api/ali/esp/intention/submit",
// content: "回调参数:" + JSON.stringify(req.body) + "回调处理订单结果:" + JSON.stringify(result),
// clientIp: client_ip || ""
// });
// res.end(JSON.stringify(result));
// return JSON.stringify(result);
// } catch (error) {
// logCtl.error({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "记录回调处理结果异常:,method=" + req.body.trxcode,
// op: "/api/ali/esp/intention/submit",
// content: "回调参数:" + JSON.stringify(req.body) + "error:" + error.stack,
// clientIp: client_ip || ""
// });
// return JSON.stringify(result);
// }
// });
// app.use('/api/alitest/esp/intention/solution/feedback', async function (req, res) {
// try {
// if (req.headers['content-type'].indexOf('application/octet-stream')>-1 ) {
// await logCtl.applicationOctetStream2Json(req);
// }
// var client_ip = system.get_client_ip(req);
// req.body.action_type = "receiveFeedback";
// var result = await utilsNeedSve.reqcenterchannel(req.body, client_ip);
// logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "回调处理订单结果:,method=" + req.body.trxcode,
// op: "/api/ali/esp/intention/solution/feedback",
// content: "回调参数:" + JSON.stringify(req.body) + "回调处理订单结果:" + JSON.stringify(result),
// clientIp: client_ip || ""
// });
// res.end(JSON.stringify(result));
// return JSON.stringify(result);
// } catch (error) {
// logCtl.error({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "记录回调处理结果异常:,method=" + req.body.trxcode,
// op: "/api/ali/esp/intention/solution/feedback",
// content: "回调参数:" + JSON.stringify(req.body) + "error:" + error.stack,
// clientIp: client_ip || ""
// });
// }
// });
// app.use('/api/alitest/ic/paySuccess', async function (req, res) {
// try {
// if (req.headers['content-type'].indexOf('application/octet-stream')>-1 ) {
// await logCtl.applicationOctetStream2Json(req);
// }
// var client_ip = system.get_client_ip(req);
// req.body.action_type = "paySuccess";
// var result = await utilsNeedSve.paySuccess(req.body, client_ip);
// logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "回调处理订单结果:,method=" + req.body.trxcode,
// op: "/api/ali/ic/paySuccess",
// content: "回调参数:" + JSON.stringify(req.body) + "回调处理订单结果:" + JSON.stringify(result),
// clientIp: client_ip || ""
// });
// res.end(JSON.stringify(result));
// return JSON.stringify(result);
// } catch (error) {
// logCtl.error({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "记录回调处理结果异常:,method=" + req.body.trxcode,
// op: "/api/ali/ic/paySuccess",
// content: "回调参数:" + JSON.stringify(req.body) + "error:" + error.stack,
// clientIp: client_ip || ""
// });
// }
// });
// app.use('/api/alitest/ic/close', async function (req, res) {
// try {
// if (req.headers['content-type'].indexOf('application/octet-stream')>-1 ) {
// await logCtl.applicationOctetStream2Json(req);
// }
// var client_ip = system.get_client_ip(req);
// req.body.action_type = "orderClose";
// var result = await utilsNeedSve.orderClose(req.body, client_ip);
// logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "回调处理订单结果:,method=" + req.body.trxcode,
// op: "/api/ali/ic/close",
// content: "回调参数:" + JSON.stringify(req.body) + "回调处理订单结果:" + JSON.stringify(result),
// clientIp: client_ip || ""
// });
// res.end(JSON.stringify(result));
// return JSON.stringify(result);
// } catch (error) {
// logCtl.error({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "记录回调处理结果异常:,method=" + req.body.trxcode,
// op: "/api/ali/ic/close",
// content: "回调参数:" + JSON.stringify(req.body) + "error:" + error.stack,
// clientIp: client_ip || ""
// });
// }
// });
// app.use('/api/alitest/esp/intention/close', async function (req, res) {
// try {
// if (req.headers['content-type'].indexOf('application/octet-stream')>-1 ) {
// await logCtl.applicationOctetStream2Json(req);
// }
// var client_ip = system.get_client_ip(req);
// req.body.action_type = "needClose";
// var result = await utilsNeedSve.reqcenterchannel(req.body, client_ip);
// logCtl.info({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "回调处理订单结果:,method=" + req.body.trxcode,
// op: "/api/ali/esp/intention/close",
// content: "回调参数:" + JSON.stringify(req.body) + "回调处理订单结果:" + JSON.stringify(result),
// clientIp: client_ip || ""
// });
// res.end(JSON.stringify(result));
// return JSON.stringify(result);
// } catch (error) {
// logCtl.error({
// optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "记录回调处理结果异常:,method=" + req.body.trxcode,
// op: "/api/ali/esp/intention/close",
// content: "回调参数:" + JSON.stringify(req.body) + "error:" + error.stack,
// clientIp: client_ip || ""
// });
// }
// });
app
.
use
(
'/api/ali/tm/consultation/submit'
,
async
function
(
req
,
res
)
{
try
{
try
{
console
.
log
(
req
.
headers
[
'content-type'
])
console
.
log
(
req
.
headers
[
'content-type'
])
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>
-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
}
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
req
.
body
.
action_type
=
"
s
ubmitNeed"
;
req
.
body
.
action_type
=
"
icpS
ubmitNeed"
;
var
result
=
await
utilsNeedSve
.
reqcenterchannel
(
req
.
body
,
client_ip
);
var
result
=
await
gatewaypushlogSve
.
icpSubmitNeed
(
req
.
body
,
client_ip
);
logCtl
.
info
({
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
op
:
"api/ali/
esp/inten
tion/submit"
,
op
:
"api/ali/
tm/consulta
tion/submit"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调处理订单结果:"
+
JSON
.
stringify
(
result
),
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调处理订单结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
...
@@ -157,24 +286,26 @@ module.exports = function (app) {
...
@@ -157,24 +286,26 @@ module.exports = function (app) {
}
catch
(
error
)
{
}
catch
(
error
)
{
logCtl
.
error
({
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调处理结果异常:,method="
+
req
.
body
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调处理结果异常:,method="
+
req
.
body
.
trxcode
,
op
:
"/api/ali/
esp/inten
tion/submit"
,
op
:
"/api/ali/
tm/consulta
tion/submit"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
return
JSON
.
stringify
(
result
);
return
JSON
.
stringify
(
result
);
}
}
});
});
app
.
use
(
'/api/alitest/esp/intention/solution/feedback'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/api/ali/tm/feedback/submit'
,
async
function
(
req
,
res
)
{
try
{
try
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
console
.
log
(
req
.
headers
[
'content-type'
])
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>
-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
}
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
req
.
body
.
action_type
=
"
receiveFeedback
"
;
req
.
body
.
action_type
=
"
icpFeedbackSubmit
"
;
var
result
=
await
utilsNeedSve
.
reqcenterchannel
(
req
.
body
,
client_ip
);
var
result
=
await
gatewaypushlogSve
.
icpFeedbackSubmit
(
req
.
body
,
client_ip
);
logCtl
.
info
({
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
op
:
"
/api/ali/esp/intention/solution/feedback
"
,
op
:
"
api/ali/tm/feedback/submit
"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调处理订单结果:"
+
JSON
.
stringify
(
result
),
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调处理订单结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
...
@@ -183,48 +314,26 @@ module.exports = function (app) {
...
@@ -183,48 +314,26 @@ module.exports = function (app) {
}
catch
(
error
)
{
}
catch
(
error
)
{
logCtl
.
error
({
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调处理结果异常:,method="
+
req
.
body
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调处理结果异常:,method="
+
req
.
body
.
trxcode
,
op
:
"/api/ali/
esp/intention/solution/feedback
"
,
op
:
"/api/ali/
tm/feedback/submit
"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
}
});
app
.
use
(
'/api/alitest/ic/paySuccess'
,
async
function
(
req
,
res
)
{
try
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
var
client_ip
=
system
.
get_client_ip
(
req
);
req
.
body
.
action_type
=
"paySuccess"
;
var
result
=
await
utilsNeedSve
.
paySuccess
(
req
.
body
,
client_ip
);
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
op
:
"/api/ali/ic/paySuccess"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调处理订单结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
});
res
.
end
(
JSON
.
stringify
(
result
));
return
JSON
.
stringify
(
result
);
return
JSON
.
stringify
(
result
);
}
catch
(
error
)
{
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调处理结果异常:,method="
+
req
.
body
.
trxcode
,
op
:
"/api/ali/ic/paySuccess"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
});
}
}
});
});
app
.
use
(
'/api/alitest/ic/close'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/api/ali/tm/status/notify'
,
async
function
(
req
,
res
)
{
try
{
try
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
console
.
log
(
req
.
headers
[
'content-type'
])
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>
-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
}
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
req
.
body
.
action_type
=
"
orderClose
"
;
req
.
body
.
action_type
=
"
icpNotify
"
;
var
result
=
await
utilsNeedSve
.
orderClose
(
req
.
body
,
client_ip
);
var
result
=
await
gatewaypushlogSve
.
icpNotify
(
req
.
body
,
client_ip
);
logCtl
.
info
({
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
op
:
"
/api/ali/ic/close
"
,
op
:
"
api/ali/tm/status/notify
"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调处理订单结果:"
+
JSON
.
stringify
(
result
),
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调处理订单结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
...
@@ -233,39 +342,14 @@ module.exports = function (app) {
...
@@ -233,39 +342,14 @@ module.exports = function (app) {
}
catch
(
error
)
{
}
catch
(
error
)
{
logCtl
.
error
({
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调处理结果异常:,method="
+
req
.
body
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调处理结果异常:,method="
+
req
.
body
.
trxcode
,
op
:
"/api/ali/
ic/close
"
,
op
:
"/api/ali/
tm/status/notify
"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
}
});
app
.
use
(
'/api/alitest/esp/intention/close'
,
async
function
(
req
,
res
)
{
try
{
if
(
req
.
headers
[
'content-type'
].
indexOf
(
'application/octet-stream'
)
>-
1
)
{
await
logCtl
.
applicationOctetStream2Json
(
req
);
}
var
client_ip
=
system
.
get_client_ip
(
req
);
req
.
body
.
action_type
=
"needClose"
;
var
result
=
await
utilsNeedSve
.
reqcenterchannel
(
req
.
body
,
client_ip
);
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
op
:
"/api/ali/esp/intention/close"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调处理订单结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
});
res
.
end
(
JSON
.
stringify
(
result
));
return
JSON
.
stringify
(
result
);
return
JSON
.
stringify
(
result
);
}
catch
(
error
)
{
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录回调处理结果异常:,method="
+
req
.
body
.
trxcode
,
op
:
"/api/ali/esp/intention/close"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
});
}
}
});
});
app
.
get
(
'/api/:gname/:qname/:method'
,
function
(
req
,
res
)
{
app
.
get
(
'/api/:gname/:qname/:method'
,
function
(
req
,
res
)
{
var
classPath
=
req
.
params
[
"qname"
];
var
classPath
=
req
.
params
[
"qname"
];
var
methodName
=
req
.
params
[
"method"
];
var
methodName
=
req
.
params
[
"method"
];
...
...
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