Commit 9a760aaf by 王栋源

wdy

parent 57c68b17
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");
const uuidv4 = require('uuid/v4');
const logCtl = system.getObject("service.common.oplogSve"); const logCtl = system.getObject("service.common.oplogSve");
//商标查询操作 //商标查询操作
class UtilsNeedSve extends AppServiceBase { class UtilsNeedSve extends AppServiceBase {
...@@ -32,19 +33,30 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -32,19 +33,30 @@ class UtilsNeedSve extends AppServiceBase {
return tokenResult; return tokenResult;
} }
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
async reqcenterchannel(pobj) { async reqcenterchannel(pobj) {
var sobj = { var sobj = {
"actionProcess":"ali", "actionProcess": "ali",
"actionType": pobj.action_type, "actionType": pobj.action_type,
"isUser": "yes", "isUser": "yes",
"actionBody": pobj "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;
} }
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; module.exports = UtilsNeedSve;
...@@ -31,6 +31,7 @@ module.exports = function (app) { ...@@ -31,6 +31,7 @@ module.exports = function (app) {
clientIp: client_ip || "" clientIp: client_ip || ""
}); });
res.end(JSON.stringify(result)); res.end(JSON.stringify(result));
return JSON.stringify(result);
} 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,
...@@ -38,6 +39,7 @@ module.exports = function (app) { ...@@ -38,6 +39,7 @@ module.exports = function (app) {
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);
} }
}); });
app.use('/api/ali/esp/intention/solution/feedback', async function (req, res) { app.use('/api/ali/esp/intention/solution/feedback', async function (req, res) {
...@@ -85,8 +87,8 @@ module.exports = function (app) { ...@@ -85,8 +87,8 @@ 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 {
var client_ip = system.get_client_ip(req); var client_ip = system.get_client_ip(req);
req.body.action_type="solutionClose"; req.body.action_type="needClose";
var result = await utilsNeedSve.opBackNotify(req.body, client_ip); var result = await utilsNeedSve.reqcenterchannel(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: "center-channel/tlpay/opBackNotify", 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