Commit a855b85a by 宋毅

tj

parent 97af5cb9
...@@ -6,6 +6,7 @@ class ProductAPI extends WEBBase { ...@@ -6,6 +6,7 @@ class ProductAPI extends WEBBase {
super(); super();
this.utilsOpOrderSve = system.getObject("service.utilsSve.utilsOpOrderSve"); this.utilsOpOrderSve = system.getObject("service.utilsSve.utilsOpOrderSve");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve"); this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -27,20 +28,25 @@ class ProductAPI extends WEBBase { ...@@ -27,20 +28,25 @@ class ProductAPI extends WEBBase {
pobj.requestId = req.requestId; pobj.requestId = req.requestId;
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "closeAliTrademarkApplication"://关闭阿里自主申请actionBody:{product_id:产品id,parentCode:商标申请实例id} case "opAliDingInterfaceManage"://操作阿里钉钉接口管理---actionBody:{为阿里需要的参数}
var pushInterfaceResult = await this.utilsOpOrderSve.getProductInterface(pobj, pobj.actionBody.product_id); var pushInterfaceResult = await this.utilsOpOrderSve.getProductInterface(pobj.appInfo, pobj.product_id);
if (pushInterfaceResult.status != 0) { if (pushInterfaceResult.status != 0) {
pobj.actionBody.product_info.interface_info = pushInterfaceResult.data; return pushInterfaceResult;
this.utilsPushSve.pushBusInfo(pobj, "closeAliTmApply", 1);
} }
break; var interface_list_temp = pushInterfaceResult.data.filter(f => f.op_type == "createAliTmApply")
case "checkTmNameByAli"://检测商标名称是否合规 if (!interface_list_temp || interface_list_temp.length == 0) {
var pushInterfaceResult = await this.utilsOpOrderSve.getProductInterface(pobj, pobj.actionBody.product_id); return system.getResult(null, "暂无【createAliTmApply】的推送配置,100520");
if (pushInterfaceResult.status != 0) {
pobj.actionBody.product_info.interface_info = pushInterfaceResult.data;
this.utilsPushSve.pushBusInfo(pobj, "closeAliTmApply", 1);
} }
pobj.interface_params = interface_list_temp[0].params;
opResult = await this.utilsTmAliyunSve.opAliDingInterfaceManage(pobj);
break; break;
// case "checkTmNameByAli"://检测商标名称是否合规
// var pushInterfaceResult = await this.utilsOpOrderSve.getProductInterface(pobj, pobj.actionBody.product_id);
// if (pushInterfaceResult.status != 0) {
// pobj.actionBody.product_info.interface_info = pushInterfaceResult.data;
// this.utilsPushSve.pushBusInfo(pobj, "closeAliTmApply", 1);
// }
// break;
case "updateContacts"://修改订单联系人 case "updateContacts"://修改订单联系人
opResult = await this.utilsOpOrderSve.updateContacts(pobj, pobj.actionBody); opResult = await this.utilsOpOrderSve.updateContacts(pobj, pobj.actionBody);
break; break;
......
...@@ -81,10 +81,10 @@ class AppServiceBase { ...@@ -81,10 +81,10 @@ class AppServiceBase {
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", requestId: pobj.requestId || "",
op: "service/app.base.js/restPostUrl", op: "service/app.base.js/execPostUrl",
content: errorMsg, content: errorMsg,
// clientIp: pobj.clientIp, // clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->restPostUrl", optitle: pobj.opType + "基类操作异常->execPostUrl",
}); });
return system.getResult(null, errorMsg); return system.getResult(null, errorMsg);
} }
...@@ -161,8 +161,8 @@ class AppServiceBase { ...@@ -161,8 +161,8 @@ class AppServiceBase {
var opType = pobj.opType || ""; var opType = pobj.opType || "";
if (result.status != 0) { if (result.status != 0) {
this.pushlogSve.createFailLogDb({ this.pushlogSve.createFailLogDb({
appid: pobj.appInfo.uapp_id, appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo.uapp_key, appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", requestId: pobj.requestId || "",
content: JSON.stringify(pobj),//推送的参数信息 content: JSON.stringify(pobj),//推送的参数信息
resultInfo: JSON.stringify(result), resultInfo: JSON.stringify(result),
...@@ -175,8 +175,8 @@ class AppServiceBase { ...@@ -175,8 +175,8 @@ class AppServiceBase {
return result; return result;
} }
this.pushlogSve.createDb({ this.pushlogSve.createDb({
appid: pobj.appInfo.uapp_id, appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo.uapp_key, appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", requestId: pobj.requestId || "",
op: "推送业务类型:" + opType, op: "推送业务类型:" + opType,
content: JSON.stringify(pobj),//推送的参数信息 content: JSON.stringify(pobj),//推送的参数信息
...@@ -192,13 +192,13 @@ class AppServiceBase { ...@@ -192,13 +192,13 @@ class AppServiceBase {
* @param {*} pobj * @param {*} pobj
* @param {*} result * @param {*} result
* @param {*} opTitleDesc * @param {*} opTitleDesc
* @param {*} failType 错误类型,1为old-rpc推送失败日志,2为new-rpc推送失败日志,业务处理失败日志 * @param {*} failType 错误类型,1为old-rpc推送失败日志,2为new-rpc推送失败日志,业务处理失败日志,3为失败日志记录
*/ */
async disposePushResultFail(pobj, result, opTitleDesc, failType) {//处理失败的结果信息--内部使用 async disposePushResultFail(pobj, result, opTitleDesc, failType) {//处理失败的结果信息--内部使用
var opType = pobj.opType || ""; var opType = pobj.opType || "";
this.pushlogSve.createFailLogDb({ this.pushlogSve.createFailLogDb({
appid: pobj.appInfo.uapp_id, appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo.uapp_key, appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", requestId: pobj.requestId || "",
content: JSON.stringify(pobj),//推送的参数信息 content: JSON.stringify(pobj),//推送的参数信息
resultInfo: JSON.stringify(result), resultInfo: JSON.stringify(result),
...@@ -211,12 +211,24 @@ class AppServiceBase { ...@@ -211,12 +211,24 @@ class AppServiceBase {
return result; return result;
} }
async getAliossjavaFileUrl(pobj, params) {//上传ali oss 文件调用 async getAliossjavaFileUrl(pobj, params) {//上传ali oss 文件调用
var opType = pobj.opType || "";
try { try {
var aliOssFileInfo = await this.execPostUrl(params, settings.aliossjavaUrl()); var aliOssFileInfo = await this.execPostUrl(params, settings.aliossjavaUrl());
if (aliOssFileInfo) { if (aliOssFileInfo == true) {
var fileUrl = params.filedir + "/" + params.objectName; var fileUrl = params.filedir + "/" + params.objectName;
return system.getResultSuccess(fileUrl); return system.getResultSuccess(fileUrl);
} }
this.pushlogSve.createFailLogDb({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
content: JSON.stringify(params),//推送的参数信息
resultInfo: JSON.stringify(aliOssFileInfo),
clientIp: pobj.clientIp || "",
failType: 3,
opTitle: opType + "aliossjava-upload阿里上传文件操作失败->getAliossjavaFileUrl",
pushNumber: 1
});
return system.getResult(null, "java ali oss upload fail"); return system.getResult(null, "java ali oss upload fail");
} catch (e) { } catch (e) {
this.logCtl.error({ this.logCtl.error({
......
...@@ -488,13 +488,13 @@ class UtilsOrderService extends AppServiceBase { ...@@ -488,13 +488,13 @@ class UtilsOrderService extends AppServiceBase {
// uappId: outTradeInfo[1], // uappId: outTradeInfo[1],
// productId: outTradeInfo.length == 3 ? outTradeInfo[2] : 0 // productId: outTradeInfo.length == 3 ? outTradeInfo[2] : 0
// } // }
opResult.data = { // opResult.data = {
orderNo: "TM36202004111014WcFs", // orderNo: "TM36202004142002tEl6",
uappId: 36, // uappId: 36,
productId: 42 // productId: 42
}; // };
//获取充值业务锁 //获取充值业务锁
await this.cacheManager["TlPayLocker"].init(opResult.data.orderNo);//---测试时放开 // await this.cacheManager["TlPayLocker"].init(opResult.data.orderNo);//---测试时放开
var locker = await this.cacheManager["TlPayLocker"].enter(opResult.data.orderNo); var locker = await this.cacheManager["TlPayLocker"].enter(opResult.data.orderNo);
if (!locker || locker != "1") { if (!locker || locker != "1") {
this.logCtl.info({ this.logCtl.info({
......
...@@ -88,6 +88,8 @@ class aliyunClient { ...@@ -88,6 +88,8 @@ class aliyunClient {
method: 'GET', // set the http method, default is GET method: 'GET', // set the http method, default is GET
headers: {}, // set the http request headers headers: {}, // set the http request headers
}); });
console.log(action,"action...........");
console.log(reqbody,"reqbody...........");
return system.getResultSuccess(res); return system.getResultSuccess(res);
} }
async reqCustomByPost(obj, cbk) { async reqCustomByPost(obj, cbk) {
......
...@@ -109,8 +109,8 @@ module.exports = function (app) { ...@@ -109,8 +109,8 @@ module.exports = function (app) {
} }
req.body.appInfo = result.data; req.body.appInfo = result.data;
req.body.actionProcess = result.data.app_code; req.body.actionProcess = result.data.app_code;
var lst = ["tmConfirm","getNeedSolutionDetailByUser", var lst = ["tmConfirm", "getNeedSolutionDetailByUser",
"submitIcpProgramme","submitIcpMaterial","acceptIcpPartnerNotification","abolishIcpProgramme", "submitIcpProgramme", "submitIcpMaterial", "acceptIcpPartnerNotification", "abolishIcpProgramme",
"addOrder", "getH5PayUrl", "getOrderQrCode", "queryOrderStatus", "getOrderInfo", "getOrderDeliveryInfo", "getOrderDetails", "addOrder", "getH5PayUrl", "getOrderQrCode", "queryOrderStatus", "getOrderInfo", "getOrderDeliveryInfo", "getOrderDetails",
"getOrderDeliveryFlowInfo", "getOrderDeliveryFlowList", "getOrderLogInfo", "updateContacts", "updateTmOrder", "delOrder", "getOrderDeliveryFlowInfo", "getOrderDeliveryFlowList", "getOrderLogInfo", "updateContacts", "updateTmOrder", "delOrder",
"submitProgramme", "getProgrammeListByUser", "getProgrammeInfoByNeedNo", "abolishProgramme", "getAliPayInfo" "submitProgramme", "getProgrammeListByUser", "getProgrammeInfoByNeedNo", "abolishProgramme", "getAliPayInfo"
......
已经使用的编码汇总: 已经使用的编码汇总:
...@@ -49,4 +49,6 @@ ...@@ -49,4 +49,6 @@
100480 100480
100490 100490
100500 100500
100510 100510
\ No newline at end of file 100520
100530
\ No newline at end of file
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