Commit 9a760aaf by 王栋源

wdy

parent 57c68b17
var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
const uuidv4 = require('uuid/v4');
const logCtl = system.getObject("service.common.oplogSve");
//商标查询操作
class UtilsNeedSve extends AppServiceBase {
......@@ -32,19 +33,30 @@ class UtilsNeedSve extends AppServiceBase {
return tokenResult;
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
async reqcenterchannel(pobj) {
var sobj = {
"actionProcess":"ali",
"actionType": pobj.action_type,
"isUser": "yes",
"actionBody": pobj
}
var tokenInfo = await this.getToken();
var url = settings.centerChannelUrl() + "web/opreceive/need/springBoard";
var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
return rtn;
async reqcenterchannel(pobj) {
var sobj = {
"actionProcess": "ali",
"actionType": pobj.action_type,
"isUser": "yes",
"actionBody": pobj
}
var tokenInfo = await this.getToken();
var url = settings.centerChannelUrl() + "web/opreceive/need/springBoard";
var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
var self=this;
return {
"requestId": self.getUUID(),
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
}
}
module.exports = UtilsNeedSve;
......@@ -31,6 +31,7 @@ module.exports = function (app) {
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,
......@@ -38,6 +39,7 @@ module.exports = function (app) {
content: "回调参数:" + JSON.stringify(req.body) + "error:" + error.stack,
clientIp: client_ip || ""
});
return JSON.stringify(result);
}
});
app.use('/api/ali/esp/intention/solution/feedback', async function (req, res) {
......@@ -85,8 +87,8 @@ module.exports = function (app) {
app.use('/api/ali/esp/intention/close', async function (req, res) {
try {
var client_ip = system.get_client_ip(req);
req.body.action_type="solutionClose";
var result = await utilsNeedSve.opBackNotify(req.body, client_ip);
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: "center-channel/tlpay/opBackNotify",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment