Commit 4e201ed1 by 宋毅

tj

parent 331a0d8a
...@@ -16,6 +16,9 @@ class AccessAuthAPI extends APIBase { ...@@ -16,6 +16,9 @@ class AccessAuthAPI extends APIBase {
} }
async taskAgainFqPushInfo(pobj, qobj, req) {//再次推送蜂擎业务数据 async taskAgainFqPushInfo(pobj, qobj, req) {//再次推送蜂擎业务数据
var rtn = await this.utilsPushSve.aliBusiness2Fq(pobj, pobj.opType); var rtn = await this.utilsPushSve.aliBusiness2Fq(pobj, pobj.opType);
if (rtn.status == 0) {
this.pushlogSve.delDbPushfaillogById(Number(pobj.id || 0));
}
return rtn; return rtn;
} }
async taskAgainPushOneNewBusInfo(pobj, qobj, req) {//再次推送新rpc业务数据 async taskAgainPushOneNewBusInfo(pobj, qobj, req) {//再次推送新rpc业务数据
...@@ -27,6 +30,9 @@ class AccessAuthAPI extends APIBase { ...@@ -27,6 +30,9 @@ class AccessAuthAPI extends APIBase {
} }
async taskAgainPushOneOldBusInfo(pobj, qobj, req) {//再次推送老rpc业务数据 async taskAgainPushOneOldBusInfo(pobj, qobj, req) {//再次推送老rpc业务数据
var rtn = await this.aliclient.reqbyget(pobj) var rtn = await this.aliclient.reqbyget(pobj)
if (rtn.status == 0) {
this.pushlogSve.delDbPushfaillogById(Number(pobj.id || 0));
}
return rtn; return rtn;
} }
async taskAliTmUpdate(pobj, qobj, req) {//操作阿里商标更新 async taskAliTmUpdate(pobj, qobj, req) {//操作阿里商标更新
...@@ -35,7 +41,26 @@ class AccessAuthAPI extends APIBase { ...@@ -35,7 +41,26 @@ class AccessAuthAPI extends APIBase {
} }
async taskAliRpcAgainPush(pobj, qobj, req) { async taskAliRpcAgainPush(pobj, qobj, req) {
var result = await this.pushlogSve.getFailLogList();
if (result.status != 0 || !result.data || result.data.length == 0) {
return system.getResult(null, "push data is empty");
}
for (let index = 0; index < result.data.length; index++) {
const element = result.data[index];
if (element) {
var contentData = JSON.parse(element.content);
contentData.id = element.id;
contentData.pushNumber = element.pushNumber + 1;
if (element.failType == 1) {
this.taskAgainPushOneOldBusInfo(contentData);
}
else if (element.failType == 2) {
this.taskAgainPushOneNewBusInfo(contentData);
} else if (element.failType == 4) {
this.taskAgainFqPushInfo(contentData);
}//FQ
}
}
return system.getResultSuccess(); return system.getResultSuccess();
} }
......
...@@ -8,6 +8,7 @@ class AppServiceBase { ...@@ -8,6 +8,7 @@ class AppServiceBase {
this.execClient = system.getObject("util.execClient"); this.execClient = system.getObject("util.execClient");
this.cacheManager = system.getObject("db.common.cacheManager"); this.cacheManager = system.getObject("db.common.cacheManager");
this.pushlogSve = system.getObject("service.common.pushlogSve"); this.pushlogSve = system.getObject("service.common.pushlogSve");
this.pushlogFailType = { OLDRPC: 1, NEWRPC: 2, FAILLOG: 3, FQ: 4 };
this.logCtl = system.getObject("service.common.oplogSve"); this.logCtl = system.getObject("service.common.oplogSve");
} }
/** /**
...@@ -157,7 +158,14 @@ class AppServiceBase { ...@@ -157,7 +158,14 @@ class AppServiceBase {
return system.getResult(null, errorMsg); return system.getResult(null, errorMsg);
} }
} }
async disposePushResult(pobj, result, opTitleDesc) {//处理结果信息--内部使用 /**
* 处理成功后的信息
* @param {*} pobj
* @param {*} result
* @param {*} opTitleDesc
* @param {*} failType this.pushlogFailType
*/
async disposePushResult(pobj, result, opTitleDesc, failType) {//处理结果信息--内部使用
var opType = pobj.opType || ""; var opType = pobj.opType || "";
if (result.status != 0) { if (result.status != 0) {
this.pushlogSve.createFailLogDb({ this.pushlogSve.createFailLogDb({
...@@ -167,7 +175,7 @@ class AppServiceBase { ...@@ -167,7 +175,7 @@ class AppServiceBase {
content: JSON.stringify(pobj),//推送的参数信息 content: JSON.stringify(pobj),//推送的参数信息
resultInfo: JSON.stringify(result), resultInfo: JSON.stringify(result),
clientIp: pobj.clientIp || "", clientIp: pobj.clientIp || "",
failType: 2, failType: failType || 3,
opTitle: opType + "推送操作失败->" + opTitleDesc, opTitle: opType + "推送操作失败->" + opTitleDesc,
pushNumber: pobj.pushNumber || 1 pushNumber: pobj.pushNumber || 1
}); });
...@@ -192,7 +200,7 @@ class AppServiceBase { ...@@ -192,7 +200,7 @@ class AppServiceBase {
* @param {*} pobj * @param {*} pobj
* @param {*} result * @param {*} result
* @param {*} opTitleDesc * @param {*} opTitleDesc
* @param {*} failType 错误类型,1为old-rpc推送失败日志,2为new-rpc推送失败日志,业务处理失败日志,3为失败日志记录 * @param {*} failType this.pushlogFailType
*/ */
async disposePushResultFail(pobj, result, opTitleDesc, failType) {//处理失败的结果信息--内部使用 async disposePushResultFail(pobj, result, opTitleDesc, failType) {//处理失败的结果信息--内部使用
var opType = pobj.opType || ""; var opType = pobj.opType || "";
...@@ -203,7 +211,7 @@ class AppServiceBase { ...@@ -203,7 +211,7 @@ class AppServiceBase {
content: JSON.stringify(pobj),//推送的参数信息 content: JSON.stringify(pobj),//推送的参数信息
resultInfo: JSON.stringify(result), resultInfo: JSON.stringify(result),
clientIp: pobj.clientIp || "", clientIp: pobj.clientIp || "",
failType: failType || 2, failType: failType || 3,
opTitle: opType + "推送操作失败->" + opTitleDesc, opTitle: opType + "推送操作失败->" + opTitleDesc,
pushNumber: pobj.pushNumber || 1 pushNumber: pobj.pushNumber || 1
}); });
......
...@@ -44,5 +44,11 @@ class PushlogService extends ServiceBase { ...@@ -44,5 +44,11 @@ class PushlogService extends ServiceBase {
async delDbPushfaillogById(id) { async delDbPushfaillogById(id) {
this.pushfaillogDao.bulkDeleteByWhere({ where: { id: id } }); this.pushfaillogDao.bulkDeleteByWhere({ where: { id: id } });
} }
async getFailLogList() {
var sql = "SELECT id,`content`,failType,pushNumber,opTitle FROM `center_channel_pushfaillog` WHERE failType IN(1,2,4) AND pushNumber<10 LIMIT 200";
var list = await this.pushfaillogDao.customQuery(sql);
var result = system.getResultSuccess(list);
return result;
}
} }
module.exports = PushlogService; module.exports = PushlogService;
...@@ -27,7 +27,7 @@ class UtilsFqAliyunService extends AppServiceBase { ...@@ -27,7 +27,7 @@ class UtilsFqAliyunService extends AppServiceBase {
verifyResult = system.getResult(null, "orderInfo.productInfo.price_item.service_code can not be empty,100430"); verifyResult = system.getResult(null, "orderInfo.productInfo.price_item.service_code can not be empty,100430");
} }
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "fq->pushOrderBusinessByProductCode2Fq->verifyResult"); return await this.disposePushResultFail(pobj, verifyResult, "fq->pushOrderBusinessByProductCode2Fq->verifyResult", this.pushlogFailType.FQ);
} }
var interface_params_info = verifyResult.data; var interface_params_info = verifyResult.data;
...@@ -44,7 +44,7 @@ class UtilsFqAliyunService extends AppServiceBase { ...@@ -44,7 +44,7 @@ class UtilsFqAliyunService extends AppServiceBase {
productQuantity: orderInfo.quantity,// 是 产品数量 productQuantity: orderInfo.quantity,// 是 产品数量
}; };
var result = await this.opAliyunClientPost(pobj, "pushOrderBusiness", interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params); var result = await this.opAliyunClientPost(pobj, "pushOrderBusiness", interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
return await this.disposePushResult(pobj, result, "fq->pushOrderBusinessByProductCode2Fq->result"); return await this.disposePushResult(pobj, result, "fq->pushOrderBusinessByProductCode2Fq->result", this.pushlogFailType.FQ);
} }
/** /**
...@@ -55,11 +55,11 @@ class UtilsFqAliyunService extends AppServiceBase { ...@@ -55,11 +55,11 @@ class UtilsFqAliyunService extends AppServiceBase {
async pushAliBusiness2Fq(pobj) {//推送阿里信息操作到峰擎 async pushAliBusiness2Fq(pobj) {//推送阿里信息操作到峰擎
var verifyResult = await this.verifyParam(pobj); var verifyResult = await this.verifyParam(pobj);
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "fq->pushAliBusiness2Fq->verifyResult"); return await this.disposePushResultFail(pobj, verifyResult, "fq->pushAliBusiness2Fq->verifyResult", this.pushlogFailType.FQ);
} }
var interface_params_info = verifyResult.data; var interface_params_info = verifyResult.data;
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, pobj.actionBody); var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, pobj.actionBody);
return await this.disposePushResult(pobj, result, "fq->pushAliBusiness2Fq->result"); return await this.disposePushResult(pobj, result, "fq->pushAliBusiness2Fq->result", this.pushlogFailType.FQ);
} }
//--------------------------------------------------内部辅助方法-------------------start----------------- //--------------------------------------------------内部辅助方法-------------------start-----------------
......
...@@ -89,12 +89,12 @@ class UtilsPushService extends AppServiceBase { ...@@ -89,12 +89,12 @@ class UtilsPushService extends AppServiceBase {
delete actionBody["product_info"]; delete actionBody["product_info"];
}//是否删除产品信息进行推送 }//是否删除产品信息进行推送
refResult = await this.restPostUrl(pobj.actionBody, interface_info.interface_url); refResult = await this.restPostUrl(pobj.actionBody, interface_info.interface_url);
this.disposePushResult(pobj, refResult, "ycUrlPush->reflexAction->refResult"); this.disposePushResult(pobj, refResult, "ycUrlPush->reflexAction->refResult", this.pushlogFailType.NEWRPC);
} }
return system.getResultSuccess(); return system.getResultSuccess();
} catch (e) { } catch (e) {
var errorResult = system.getResult(null, "送异常-->reflexAction->" + e.stack) var errorResult = system.getResult(null, "送异常-->reflexAction->" + e.stack)
return await this.disposePushResultFail(pobj, errorResult, "数据推送异常-->reflexAction-->errorResult"); return await this.disposePushResultFail(pobj, errorResult, "数据推送异常-->reflexAction-->errorResult", this.pushlogFailType.FAILLOG);
} }
} }
} }
......
...@@ -10,36 +10,36 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -10,36 +10,36 @@ class UtilsTmAliyunService extends AppServiceBase {
this.aliOssFileType = { ICON: "ICON", CARD: "CARD", ATTORNEY: "ATTORNEY", PASSPORT: "PASSPORT", BUSINESS_LICENSE: "BUSINESS_LICENSE", LEGAL_NOTICE: "LEGAL_NOTICE", SUPPLEMENT: "SUPPLEMENT" }; this.aliOssFileType = { ICON: "ICON", CARD: "CARD", ATTORNEY: "ATTORNEY", PASSPORT: "PASSPORT", BUSINESS_LICENSE: "BUSINESS_LICENSE", LEGAL_NOTICE: "LEGAL_NOTICE", SUPPLEMENT: "SUPPLEMENT" };
} }
//推送委托书模板邮件(阿里云) //推送委托书模板邮件(阿里云)
async sendAliWtsEmail(pobj){ async sendAliWtsEmail(pobj) {
var ab = pobj.actionBody; var ab = pobj.actionBody;
if(!ab.email){ if (!ab.email) {
return system.getResult(null, "邮箱地址不能为空"); return system.getResult(null, "邮箱地址不能为空");
} }
if(!ab.type){ if (!ab.type) {
return system.getResult(null, "邮件类型不能为空"); return system.getResult(null, "邮件类型不能为空");
} }
var mailCilent = system.getObject("util.mailClient"); var mailCilent = system.getObject("util.mailClient");
var url = ""; var url = "";
if(ab.type=="1"){ if (ab.type == "1") {
var sendRes = await mailCilent.sendMsg(ab.email,"商标代理委托书","see","商标代理委托书",null,null,[ var sendRes = await mailCilent.sendMsg(ab.email, "商标代理委托书", "see", "商标代理委托书", null, null, [
{filename: '商标代理委托书',path: 'http://gsb-zc.oss-cn-beijing.aliyuncs.com/igirl_channel_tmwtsdemo001.doc'} { filename: '商标代理委托书', path: 'http://gsb-zc.oss-cn-beijing.aliyuncs.com/igirl_channel_tmwtsdemo001.doc' }
]); ]);
return system.getResultSuccess(sendRes); return system.getResultSuccess(sendRes);
}else if(ab.type=="2"){ } else if (ab.type == "2") {
var sendRes = await mailCilent.sendMsg(ab.email,"阿里云商标代理委托书","see","阿里云商标代理委托书",null,null,[ var sendRes = await mailCilent.sendMsg(ab.email, "阿里云商标代理委托书", "see", "阿里云商标代理委托书", null, null, [
{filename: '阿里云商标代理委托书',path: 'http://gsb-zc.oss-cn-beijing.aliyuncs.com/tmwtu2020041811188516gcjhvjwts.docx'} { filename: '阿里云商标代理委托书', path: 'http://gsb-zc.oss-cn-beijing.aliyuncs.com/tmwtu2020041811188516gcjhvjwts.docx' }
]); ]);
return system.getResultSuccess(sendRes); return system.getResultSuccess(sendRes);
}else if(ab.type=="3"){ } else if (ab.type == "3") {
var sendRes = await mailCilent.sendMsg(ab.email,"阿里云声明文件","see","阿里云声明文件",null,null,[ var sendRes = await mailCilent.sendMsg(ab.email, "阿里云声明文件", "see", "阿里云声明文件", null, null, [
{filename: '阿里云声明文件',path: 'http://gsb-zc.oss-cn-beijing.aliyuncs.com/tm_smwj202004181626725onjdaliyun.doc'} { filename: '阿里云声明文件', path: 'http://gsb-zc.oss-cn-beijing.aliyuncs.com/tm_smwj202004181626725onjdaliyun.doc' }
]); ]);
return system.getResultSuccess(sendRes); return system.getResultSuccess(sendRes);
}else{ } else {
return system.getResult(null, "邮件类型错误"); return system.getResult(null, "邮件类型错误");
} }
} }
async tmCreateApplicant(pobj) {//创建商标申请人信息 async tmCreateApplicant(pobj) {//创建商标申请人信息
var verifyResult = await this.opAliyunRpcVerifyParam(pobj); var verifyResult = await this.opAliyunRpcVerifyParam(pobj);
...@@ -49,35 +49,35 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -49,35 +49,35 @@ class UtilsTmAliyunService extends AppServiceBase {
var tmInfo = pobj.actionBody.delivery_content.tm; var tmInfo = pobj.actionBody.delivery_content.tm;
if (!orderInfo) { if (!orderInfo) {
verifyResult = system.getResult(null, "orderInfo data is empty,100450"); verifyResult = system.getResult(null, "orderInfo data is empty,100450");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (Number(orderInfo.orderStatus) != 2) { if (Number(orderInfo.orderStatus) != 2) {
verifyResult = system.getResult(null, "orderInfo status is error,100453"); verifyResult = system.getResult(null, "orderInfo status is error,100453");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (!apply) { if (!apply) {
verifyResult = system.getResult(null, "apply data is empty,100455"); verifyResult = system.getResult(null, "apply data is empty,100455");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (apply.customerType != "ent" && !apply.identityCardPic) { if (apply.customerType != "ent" && !apply.identityCardPic) {
verifyResult = system.getResult(null, "identityCardPic can not be empty,100456"); verifyResult = system.getResult(null, "identityCardPic can not be empty,100456");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (apply.customerType == "ent" && !apply.businessLicensePic) { if (apply.customerType == "ent" && !apply.businessLicensePic) {
verifyResult = system.getResult(null, "businessLicensePic can not be empty,100457"); verifyResult = system.getResult(null, "businessLicensePic can not be empty,100457");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (!apply.gzwtsUrl) { if (!apply.gzwtsUrl) {
verifyResult = system.getResult(null, "gzwtsUrl can not be empty,100458"); verifyResult = system.getResult(null, "gzwtsUrl can not be empty,100458");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (!tmInfo) { if (!tmInfo) {
verifyResult = system.getResult(null, "tmInfo data is empty,100460"); verifyResult = system.getResult(null, "tmInfo data is empty,100460");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (!tmInfo.picUrl) { if (!tmInfo.picUrl) {
verifyResult = system.getResult(null, "tm picUrl data is empty,100461"); verifyResult = system.getResult(null, "tm picUrl data is empty,100461");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
var rpcParam = verifyResult.data; var rpcParam = verifyResult.data;
var idCardOssKey = ""; var idCardOssKey = "";
...@@ -121,7 +121,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -121,7 +121,7 @@ class UtilsTmAliyunService extends AppServiceBase {
} }
} }
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult"); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.NEWRPC);
} }
var actionBody = { var actionBody = {
ContactName: orderContact.contactName || "",//String 否 张三 联系人姓名 ContactName: orderContact.contactName || "",//String 否 张三 联系人姓名
...@@ -155,7 +155,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -155,7 +155,7 @@ class UtilsTmAliyunService extends AppServiceBase {
if (applicantResult.status != 0) { if (applicantResult.status != 0) {
applicantResult = await this.opAliyunRpcReq(pobj, params); applicantResult = await this.opAliyunRpcReq(pobj, params);
if (applicantResult.status != 0) { if (applicantResult.status != 0) {
return await this.disposePushResultFail(pobj, applicantResult, "ali->tmCreateApplicant->applicantResult"); return await this.disposePushResultFail(pobj, applicantResult, "ali->tmCreateApplicant->applicantResult", this.pushlogFailType.NEWRPC);
} }
} }
...@@ -178,7 +178,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -178,7 +178,7 @@ class UtilsTmAliyunService extends AppServiceBase {
if (classificationsResult.status != 0) { if (classificationsResult.status != 0) {
classificationsResult.msg = "获取阿里尼斯数据为空,100469->" + classificationsResult.msg; classificationsResult.msg = "获取阿里尼斯数据为空,100469->" + classificationsResult.msg;
pobj.dbNclonesItem = nclonesItem; pobj.dbNclonesItem = nclonesItem;
self.disposePushResultFail(pobj, classificationsResult, "ali->tmCreateApplicant->classificationsResult", 3); self.disposePushResultFail(pobj, classificationsResult, "ali->tmCreateApplicant->classificationsResult", self.pushlogFailType.FAILLOG);
break; break;
}//第二次调用失败则尼斯调用失败 }//第二次调用失败则尼斯调用失败
} }
...@@ -188,7 +188,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -188,7 +188,7 @@ class UtilsTmAliyunService extends AppServiceBase {
if (tmCreateResult.status != 0) { if (tmCreateResult.status != 0) {
tmCreateResult.msg = "创建阿里商标数据为空,10471->" + tmCreateResult.msg; tmCreateResult.msg = "创建阿里商标数据为空,10471->" + tmCreateResult.msg;
pobj.dbTmInfo = tmInfo; pobj.dbTmInfo = tmInfo;
self.disposePushResultFail(pobj, tmCreateResult, "ali->tmCreateApplicant->classificationsResult", 3); self.disposePushResultFail(pobj, tmCreateResult, "ali->tmCreateApplicant->classificationsResult", self.pushlogFailType.FAILLOG);
break; break;
}//第二次调用失败则创建商标失败 }//第二次调用失败则创建商标失败
} }
...@@ -202,11 +202,11 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -202,11 +202,11 @@ class UtilsTmAliyunService extends AppServiceBase {
} }
if (addtmCreate == pobj.actionBody.delivery_content.nclones.length) { if (addtmCreate == pobj.actionBody.delivery_content.nclones.length) {
self.addAliChannelTmApplicant(pobj, addActionBody); self.addAliChannelTmApplicant(pobj, addActionBody);
return await self.disposePushResult(pobj, tmCreateResult, "ali->tmCreateApplicant->tmCreateResult"); return await self.disposePushResult(pobj, tmCreateResult, "ali->tmCreateApplicant->tmCreateResult", this.pushlogFailType.NEWRPC);
}//更新数据库渠道商标 }//更新数据库渠道商标
else { else {
tmCreateResult = system.getResult(null, "创建ali商标申请人信息出错,10472"); tmCreateResult = system.getResult(null, "创建ali商标申请人信息出错,10472");
return await self.disposePushResultFail(pobj, tmCreateResult, "ali->tmCreateApplicant->tmCreateResult"); return await self.disposePushResultFail(pobj, tmCreateResult, "ali->tmCreateApplicant->tmCreateResult", self.pushlogFailType.NEWRPC);
} }
} }
async updateAliTmApplicant(pobj) {//更新商标申请人信息 async updateAliTmApplicant(pobj) {//更新商标申请人信息
...@@ -225,24 +225,24 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -225,24 +225,24 @@ class UtilsTmAliyunService extends AppServiceBase {
} }
}//为空则进行创建提交到阿里 }//为空则进行创建提交到阿里
verifyResult = dbApplyResult + ",100540"; verifyResult = dbApplyResult + ",100540";
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (!apply.gzwtsUrl) { if (!apply.gzwtsUrl) {
verifyResult = system.getResult(null, "gzwtsUrl can not be empty,100541"); verifyResult = system.getResult(null, "gzwtsUrl can not be empty,100541");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
var dbApply = dbApplyResult.data.apply; var dbApply = dbApplyResult.data.apply;
var dbTm = dbApplyResult.data.tm; var dbTm = dbApplyResult.data.tm;
if (!dbApply) { if (!dbApply) {
verifyResult = system.getResult(null, "tmInfo data is empty,100542"); verifyResult = system.getResult(null, "tmInfo data is empty,100542");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (!dbTm) { if (!dbTm) {
verifyResult = system.getResult(null, "dbTm data is empty,100543"); verifyResult = system.getResult(null, "dbTm data is empty,100543");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "ali->updateAliTmApplicant->verifyResult"); return await this.disposePushResultFail(pobj, verifyResult, "ali->updateAliTmApplicant->verifyResult", this.pushlogFailType.NEWRPC);
} }
var rpcParam = verifyResult.data; var rpcParam = verifyResult.data;
var idCardOssKey = ""; var idCardOssKey = "";
...@@ -294,11 +294,11 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -294,11 +294,11 @@ class UtilsTmAliyunService extends AppServiceBase {
if (apply.customerType != "ent" && !dbApply.IdCardOssKey) { if (apply.customerType != "ent" && !dbApply.IdCardOssKey) {
verifyResult = system.getResult(null, "identityCardPic can not be empty,100544"); verifyResult = system.getResult(null, "identityCardPic can not be empty,100544");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (apply.customerType == "ent" && !dbApply.BusinessLicenceOssKey) { if (apply.customerType == "ent" && !dbApply.BusinessLicenceOssKey) {
verifyResult = system.getResult(null, "businessLicensePic can not be empty,100545"); verifyResult = system.getResult(null, "businessLicensePic can not be empty,100545");
return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->tmCreateApplicant->verifyResult", this.pushlogFailType.FAILLOG);
} }
if (dbApply.ApplicantId) { if (dbApply.ApplicantId) {
...@@ -314,7 +314,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -314,7 +314,7 @@ class UtilsTmAliyunService extends AppServiceBase {
applicantResult = await this.opAliyunRpcReq(pobj, params); applicantResult = await this.opAliyunRpcReq(pobj, params);
if (applicantResult.status != 0) { if (applicantResult.status != 0) {
applicantResult.msg = "创建阿里商标申请人出错,100546->" + applicantResult.msg; applicantResult.msg = "创建阿里商标申请人出错,100546->" + applicantResult.msg;
return await this.disposePushResultFail(pobj, applicantResult, "ali->updateAliTmApplicant->CreateApplicant->applicantResult"); return await this.disposePushResultFail(pobj, applicantResult, "ali->updateAliTmApplicant->CreateApplicant->applicantResult", this.pushlogFailType.NEWRPC);
} }
} }
...@@ -334,13 +334,13 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -334,13 +334,13 @@ class UtilsTmAliyunService extends AppServiceBase {
if (getDingTmStatusResult.status != 0) { if (getDingTmStatusResult.status != 0) {
pobj.dbTm = tmItem; pobj.dbTm = tmItem;
getDingTmStatusResult.msg = "查询阿里商标状态出错,100547->" + getDingTmStatusResult.msg; getDingTmStatusResult.msg = "查询阿里商标状态出错,100547->" + getDingTmStatusResult.msg;
self.disposePushResultFail(pobj, getDingTmStatusResult, "ali->updateAliTmApplicant->getDingTmStatusResult", 3); self.disposePushResultFail(pobj, getDingTmStatusResult, "ali->updateAliTmApplicant->getDingTmStatusResult", self.pushlogFailType.FAILLOG);
break; break;
} }
if (getDingTmStatusResult.data.TrademarkApplications.TrademarkApplication[0].ApplicationStatus != 2) { if (getDingTmStatusResult.data.TrademarkApplications.TrademarkApplication[0].ApplicationStatus != 2) {
getDingTmStatusResult.status = -1; getDingTmStatusResult.status = -1;
getDingTmStatusResult = "更新商标申请人信息失败,阿里商标状态不是阿里云审核不通过,不能进行修改,100558->" + getDingTmStatusResult.msg; getDingTmStatusResult = "更新商标申请人信息失败,阿里商标状态不是阿里云审核不通过,不能进行修改,100558->" + getDingTmStatusResult.msg;
self.disposePushResultFail(pobj, getDingTmStatusResult, "ali->updateAliTmApplicant->getDingTmStatusResult", 3); self.disposePushResultFail(pobj, getDingTmStatusResult, "ali->updateAliTmApplicant->getDingTmStatusResult", self.pushlogFailType.FAILLOG);
continue; continue;
} }
bizId = getDingTmStatusResult.data.TrademarkApplications.TrademarkApplication[0].BizId; bizId = getDingTmStatusResult.data.TrademarkApplications.TrademarkApplication[0].BizId;
...@@ -358,7 +358,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -358,7 +358,7 @@ class UtilsTmAliyunService extends AppServiceBase {
if (bindAliTmApplicantGzwtsUrlResult.status != 0) { if (bindAliTmApplicantGzwtsUrlResult.status != 0) {
pobj.dbTm = tmItem; pobj.dbTm = tmItem;
bindAliTmApplicantGzwtsUrlResult.msg = "绑定授权书Oss文件出错,100559->" + bindAliTmApplicantGzwtsUrlResult.msg; bindAliTmApplicantGzwtsUrlResult.msg = "绑定授权书Oss文件出错,100559->" + bindAliTmApplicantGzwtsUrlResult.msg;
self.disposePushResultFail(pobj, bindAliTmApplicantGzwtsUrlResult, "ali->updateAliTmApplicant->bindAliTmApplicantGzwtsUrlResult", 3); self.disposePushResultFail(pobj, bindAliTmApplicantGzwtsUrlResult, "ali->updateAliTmApplicant->bindAliTmApplicantGzwtsUrlResult", self.pushlogFailType.FAILLOG);
break; break;
} }
updateTm++; updateTm++;
...@@ -366,11 +366,11 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -366,11 +366,11 @@ class UtilsTmAliyunService extends AppServiceBase {
} }
if (updateTm == dbTm.length) { if (updateTm == dbTm.length) {
self.updateAliChannelTmApplicant(pobj, dbApplyResult.data); self.updateAliChannelTmApplicant(pobj, dbApplyResult.data);
return self.disposePushResult(pobj, opUpdateTmResult, "ali->updateAliTmApplicant->opUpdateTmResult"); return await self.disposePushResult(pobj, opUpdateTmResult, "ali->updateAliTmApplicant->opUpdateTmResult", self.pushlogFailType.NEWRPC);
}//更新数据库渠道商标 }//更新数据库渠道商标
else { else {
opUpdateTmResult = system.getResult(null, "更新ali商标申请人信息出错,100548"); opUpdateTmResult = system.getResult(null, "更新ali商标申请人信息出错,100548");
return self.disposePushResultFail(pobj, opUpdateTmResult, "ali->updateAliTmApplicant->opUpdateTmResult"); return await self.disposePushResultFail(pobj, opUpdateTmResult, "ali->updateAliTmApplicant->opUpdateTmResult", self.pushlogFailType.NEWRPC);
} }
} }
...@@ -543,7 +543,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -543,7 +543,7 @@ class UtilsTmAliyunService extends AppServiceBase {
var reqUrl = settings.centerOrderUrl() + "opaction/opOrder/springBoard"; var reqUrl = settings.centerOrderUrl() + "opaction/opOrder/springBoard";
var result = await this.restPostUrl(tmpPobj, reqUrl); var result = await this.restPostUrl(tmpPobj, reqUrl);
if (result.status != 0) { if (result.status != 0) {
return await this.disposePushResultFail(tmpPobj, result, "ali->tmCreateApplicant->addChannelTmApplicantResult->新增ali渠道商标交付信息失败", 3); return await this.disposePushResultFail(tmpPobj, result, "ali->tmCreateApplicant->addChannelTmApplicantResult->新增ali渠道商标交付信息失败", this.pushlogFailType.FAILLOG);
} }
return result; return result;
} }
...@@ -556,7 +556,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -556,7 +556,7 @@ class UtilsTmAliyunService extends AppServiceBase {
var reqUrl = settings.centerOrderUrl() + "opaction/opOrder/springBoard"; var reqUrl = settings.centerOrderUrl() + "opaction/opOrder/springBoard";
var result = await this.restPostUrl(tmpPobj, reqUrl); var result = await this.restPostUrl(tmpPobj, reqUrl);
if (result.status != 0) { if (result.status != 0) {
return await this.disposePushResultFail(tmpPobj, result, "ali->tmCreateApplicant->addChannelTmApplicantResult->新增ali渠道商标交付信息失败", 3); return await this.disposePushResultFail(tmpPobj, result, "ali->tmCreateApplicant->addChannelTmApplicantResult->新增ali渠道商标交付信息失败", this.pushlogFailType.FAILLOG);
} }
return result; return result;
} }
...@@ -597,7 +597,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -597,7 +597,7 @@ class UtilsTmAliyunService extends AppServiceBase {
async opAliDingInterfaceManage(pobj) {//操作阿里钉钉接口管理---外部调用 async opAliDingInterfaceManage(pobj) {//操作阿里钉钉接口管理---外部调用
var verifyResult = await this.opAliyunRpcVerifyParam(pobj); var verifyResult = await this.opAliyunRpcVerifyParam(pobj);
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "ali->opAliDingInterfaceManage->verifyResult", 3); return await this.disposePushResultFail(pobj, verifyResult, "ali->opAliDingInterfaceManage->verifyResult", this.pushlogFailType.FAILLOG);
} }
var rpcParam = verifyResult.data; var rpcParam = verifyResult.data;
var params = { var params = {
...@@ -617,7 +617,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -617,7 +617,7 @@ class UtilsTmAliyunService extends AppServiceBase {
var dbAliAllTmListResult = await this.getAllAliChannelTmDelivery(pobj); var dbAliAllTmListResult = await this.getAllAliChannelTmDelivery(pobj);
if (dbAliAllTmListResult.status != 0) { if (dbAliAllTmListResult.status != 0) {
dbAliAllTmListResult.msg = "操作阿里商标更新任务,查询的数据为空,100550->" + dbAliAllTmListResult.msg; dbAliAllTmListResult.msg = "操作阿里商标更新任务,查询的数据为空,100550->" + dbAliAllTmListResult.msg;
return await this.disposePushResultFail(pobj, dbAliAllTmListResult, "ali->opAliTmUpdateTask->dbAliAllTmListResult", 3); return await this.disposePushResultFail(pobj, dbAliAllTmListResult, "ali->opAliTmUpdateTask->dbAliAllTmListResult", this.pushlogFailType.FAILLOG);
} }
var opResult = system.getResultSuccess(); var opResult = system.getResultSuccess();
var rpcParam = null; var rpcParam = null;
...@@ -635,13 +635,13 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -635,13 +635,13 @@ class UtilsTmAliyunService extends AppServiceBase {
if (pushInterfaceResult.status != 0) { if (pushInterfaceResult.status != 0) {
pushInterfaceResult.msg = "操作阿里商标更新任务,查询的产品接口数据为空,100553->" + pushInterfaceResult.msg; pushInterfaceResult.msg = "操作阿里商标更新任务,查询的产品接口数据为空,100553->" + pushInterfaceResult.msg;
opResult = pushInterfaceResult; opResult = pushInterfaceResult;
self.disposePushResultFail(pobj, pushInterfaceResult, "ali->opAliTmUpdateTask->pushInterfaceResult", 3); self.disposePushResultFail(pobj, pushInterfaceResult, "ali->opAliTmUpdateTask->pushInterfaceResult", self.pushlogFailType.FAILLOG);
break; break;
} }
var interface_list_temp = pushInterfaceResult.data.filter(f => f.op_type == "createAliTmApply"); var interface_list_temp = pushInterfaceResult.data.filter(f => f.op_type == "createAliTmApply");
if (!interface_list_temp || interface_list_temp.length == 0) { if (!interface_list_temp || interface_list_temp.length == 0) {
opResult = system.getResult(null, "暂无【createAliTmApply】的推送配置,100555"); opResult = system.getResult(null, "暂无【createAliTmApply】的推送配置,100555");
self.disposePushResultFail(pobj, opResult, "ali->opAliTmUpdateTask->interface_list_temp", 3); self.disposePushResultFail(pobj, opResult, "ali->opAliTmUpdateTask->interface_list_temp", self.pushlogFailType.FAILLOG);
break; break;
} }
rpcParam = JSON.parse(interface_list_temp[0].params); rpcParam = JSON.parse(interface_list_temp[0].params);
...@@ -654,7 +654,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -654,7 +654,7 @@ class UtilsTmAliyunService extends AppServiceBase {
if (getDingTmStatusResult.status != 0 || getDingTmStatusResult.data.TotalCount == 0) { if (getDingTmStatusResult.status != 0 || getDingTmStatusResult.data.TotalCount == 0) {
getDingTmStatusResult.msg = "操作阿里商标更新任务,查询的阿里商标数据错误,100557->" + getDingTmStatusResult.msg; getDingTmStatusResult.msg = "操作阿里商标更新任务,查询的阿里商标数据错误,100557->" + getDingTmStatusResult.msg;
opResult = getDingTmStatusResult; opResult = getDingTmStatusResult;
self.disposePushResultFail(pobj, getDingTmStatusResult, "ali->opAliTmUpdateTask->getDingTmStatusResult", 3); self.disposePushResultFail(pobj, getDingTmStatusResult, "ali->opAliTmUpdateTask->getDingTmStatusResult", self.pushlogFailType.FAILLOG);
break; break;
} }
if (getDingTmStatusResult.data.TrademarkApplications.TrademarkApplication[0].Note) { if (getDingTmStatusResult.data.TrademarkApplications.TrademarkApplication[0].Note) {
...@@ -697,7 +697,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -697,7 +697,7 @@ class UtilsTmAliyunService extends AppServiceBase {
var aliStatusResult = await this.aliStatusInfo(getDingTmStatusResult); var aliStatusResult = await this.aliStatusInfo(getDingTmStatusResult);
if (aliStatusResult.status != 0) { if (aliStatusResult.status != 0) {
aliStatusResult.msg = "异步操作启服通商标状态更新->阿里状态码表匹配失败->" + aliStatusResult.msg; aliStatusResult.msg = "异步操作启服通商标状态更新->阿里状态码表匹配失败->" + aliStatusResult.msg;
this.disposePushResultFail(pobj, aliStatusResult, "ali->opSelfTmStatusUpdate->aliStatusResult", 3); this.disposePushResultFail(pobj, aliStatusResult, "ali->opSelfTmStatusUpdate->aliStatusResult", this.pushlogFailType.FAILLOG);
return aliStatusResult; return aliStatusResult;
} }
var actionBody = { var actionBody = {
...@@ -712,7 +712,7 @@ class UtilsTmAliyunService extends AppServiceBase { ...@@ -712,7 +712,7 @@ class UtilsTmAliyunService extends AppServiceBase {
var opResult = await this.execPostUrl(actionBody, reqUrl); var opResult = await this.execPostUrl(actionBody, reqUrl);
if (opResult.status != 0) { if (opResult.status != 0) {
opResult.msg = "异步操作启服通商标状态更新失败->" + opResult.msg; opResult.msg = "异步操作启服通商标状态更新失败->" + opResult.msg;
this.disposePushResultFail(pobj, opResult, "ali->opSelfTmStatusUpdate->opResult", 3); this.disposePushResultFail(pobj, opResult, "ali->opSelfTmStatusUpdate->opResult", this.pushlogFailType.FAILLOG);
} }
return opResult; return opResult;
} }
......
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