Commit 367147da by 宋毅

tj

parent 4eeff8b5
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/igirl-channel.iml" filepath="$PROJECT_DIR$/.idea/igirl-channel.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
...@@ -9,6 +9,7 @@ class APIBase { ...@@ -9,6 +9,7 @@ class APIBase {
this.logCtl = system.getObject("service.common.oplogSve"); this.logCtl = system.getObject("service.common.oplogSve");
this.toolSve = system.getObject("service.trademark.toolSve"); this.toolSve = system.getObject("service.trademark.toolSve");
this.exTime = 6 * 3600;//缓存过期时间,6小时 this.exTime = 6 * 3600;//缓存过期时间,6小时
this.execClientNew = system.getObject("util.execClientNew");
} }
getUUID() { getUUID() {
var uuid = uuidv4(); var uuid = uuidv4();
...@@ -142,44 +143,13 @@ class APIBase { ...@@ -142,44 +143,13 @@ class APIBase {
if (rtn && !rtn.requestId) { if (rtn && !rtn.requestId) {
rtn.requestId = requestid; rtn.requestId = requestid;
} }
if (methodname != "test") { var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.logCtl.createDb({ this.execClientNew.execLogs("igirl-channel-doexecMethod-reqPath:" + req.path, pobj, "igirl-channel-doexecMethod", tmpResult, null);
appid: req.app.id,
appkey: req.app.uappKey,
requestId: requestid,
op: req.classname + "/" + methodname,
content: JSON.stringify(pobj),
resultInfo: JSON.stringify(rtn),
clientIp: req.clientIp,
agent: req.uagent,
opTitle: "api服务提供方appKey:" + settings.appKey,
});
}
return rtn; return rtn;
} catch (e) { } catch (e) {
console.log(e.stack, "api调用出现异常,请联系管理员..........") const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.logCtl.createDb({ this.execClientNew.execLogs("igirl-channel-doexecMethod-reqPath异常:" + req.path, pobj, "center-channel-doexecMethod", null, stackStr);
appid: req.app.id, var rtnerror = system.getResultFail(-200, "出现异常,error:" + stackStr);
appkey: req.app.uappKey,
requestId: requestid,
op: req.classname + "/" + methodname,
content: JSON.stringify(pobj),
resultInfo: JSON.stringify(e.stack),
clientIp: req.clientIp,
agent: req.uagent,
opTitle: "api调用出现异常,请联系管理员error,appKey:" + settings.appKey,
});
this.logCtl.error({
appid: req.app.id,
appkey: req.app.uappKey,
requestId: requestid,
op: pobj.classname + "/" + methodname,
content: e.stack,
clientIp: pobj.clientIp,
agent: req.uagent,
optitle: "api调用出现异常,请联系管理员",
});
var rtnerror = system.getResultFail(-200, "出现异常,error:" + e.stack);
rtnerror.requestId = requestid; rtnerror.requestId = requestid;
return rtnerror; return rtnerror;
} }
......
...@@ -16,6 +16,7 @@ class TmOrderAPI extends APIBase { ...@@ -16,6 +16,7 @@ class TmOrderAPI extends APIBase {
this.toolSve = system.getObject("service.trademark.toolSve"); this.toolSve = system.getObject("service.trademark.toolSve");
this.appProductSve = system.getObject("service.dbapp.appproductSve"); this.appProductSve = system.getObject("service.dbapp.appproductSve");
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve"); this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
this.logCtl = system.getObject("service.common.oplogSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -74,21 +75,21 @@ class TmOrderAPI extends APIBase { ...@@ -74,21 +75,21 @@ class TmOrderAPI extends APIBase {
pobj.actionBody.orderContact.mobile = pobj.actionBody.buyerMoblie; pobj.actionBody.orderContact.mobile = pobj.actionBody.buyerMoblie;
pobj.actionBody.orderContact.email = pobj.actionBody.email; pobj.actionBody.orderContact.email = pobj.actionBody.email;
opResult = await this.orderSve.addQifuOrder(pobj, pobj.actionBody, req); opResult = await this.orderSve.addQifuOrder(pobj, pobj.actionBody, req);
if (opResult.status == 0 && opResult.serviceCode && pobj.actionBody.buyerMoblie) { // if (opResult.status == 0 && opResult.serviceCode && pobj.actionBody.buyerMoblie) {
pobj.actionBody = { // pobj.actionBody = {
idempotentId: opResult.data.orderNo,// 是 业务 ID // idempotentId: opResult.data.orderNo,// 是 业务 ID
idempotentSource: req.app.appSourceCode ? "ic_" + req.app.appSourceCode : "tm_1688",// 是 业务来源(ali、jd) // idempotentSource: req.app.appSourceCode ? "ic_" + req.app.appSourceCode : "tm_1688",// 是 业务来源(ali、jd)
idempotentSourceName: req.app.name || "1688应用",// 是 阿里,京东 // idempotentSourceName: req.app.name || "1688应用",// 是 阿里,京东
city: "",// 否 所属城市 // city: "",// 否 所属城市
phone: pobj.actionBody.buyerMoblie,// 是 手机号 // phone: pobj.actionBody.buyerMoblie,// 是 手机号
userId: pobj.actionBody.channelUserId,// 否 用户 ID // userId: pobj.actionBody.channelUserId,// 否 用户 ID
companyName: "",// 否 公司名称 // companyName: "",// 否 公司名称
orderPrice: opResult.totalSum,// 是 订单金额 // orderPrice: opResult.totalSum,// 是 订单金额
productId: opResult.serviceCode,// 是 产品 ID // productId: opResult.serviceCode,// 是 产品 ID
productQuantity: 1,// 是 产品数量 // productQuantity: 1,// 是 产品数量
}; // };
await this.orderSve.againPushFqBusiness(pobj, req); // await this.orderSve.againPushFqBusiness(pobj, req);
}//推送商机到峰擎 // }//推送商机到峰擎
break; break;
case "getOrderInfo": case "getOrderInfo":
opResult = await this.orderSve.getOrderInfo(pobj, action_body, req); opResult = await this.orderSve.getOrderInfo(pobj, action_body, req);
......
...@@ -859,7 +859,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -859,7 +859,7 @@ class OrderTmProductService extends ServiceBase {
for (let i = 0; i < tmOfficialsList.length; i++) { for (let i = 0; i < tmOfficialsList.length; i++) {
const element = tmOfficialsList[i]; const element = tmOfficialsList[i];
if (element) { if (element) {
tm.push({ tm.tmOfficials.push({
officialType: element.officialType, officialType: element.officialType,
officialTypeName: element.officialTypeName, officialTypeName: element.officialTypeName,
officialFileUrl: element.officialFileUrl, officialFileUrl: element.officialFileUrl,
......
...@@ -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 || 4003, port: process.env.NODE_PORT || 4003,
//记录日志地址
opNewLogUrl() {
if (this.env == 'dev') {
return "http://43.247.184.94:7200/igirl_channel_req_log/_doc?pretty";
}
return "http://43.247.184.94:7200/igirl_channel_req_log/_doc?pretty";
},
paasUrl: function () { paasUrl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "http://p.apps.com:4001/"; return "http://p.apps.com:4001/";
......
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