Commit 2d80c229 by 宋毅

tj

parent 90143273
......@@ -1357,53 +1357,75 @@ class TrademarkService extends ServiceBase {
var official_type = uiconfig.config.pdict.tm_submit_status;
var official_type_name = official_type[tmStatus];
//默认失败
var opResult = { code: -110, msg: "failure no update" };
await this.db.transaction(async function (t) {
if (item.tmStatus != tmStatus) {
await self.dao.updateByWhere(setParam, { where: { proxyCode: item.proxyCode } }, t);
opResult.msg = "succeed";
opResult.code = 1;
}
if (pObj.applyNo || ["ALIPAPERS2", "RECVCOMMIT", "3", "4", "7", "8", "9", "13"].indexOf(tmStatus) >= 0) {//操作回执
var fileName = official_type_name + "_" + item.tmName + "_" + item.nclOneCodes;
var flowWhere = { where: { tmRegistNum: pObj.applyNo, tmStatus: tmStatus } };
var flowCount = await self.tmflowDao.findCount(flowWhere);
var params = {
tmStatus: tmStatus,
uploadFileName: fileName,
// returnReceiptUrl: pObj.fileUrl,//TODO:需要下载下来重新保存
tmRegistNum: pObj.applyNo,
};
if (pObj.fileUrl) {
// var opUrlResult = {
// code: 1,
// message: "success",
// data: {}
// };
// var opDownFileResult = await self.opDownFileInfo(pObj.fileUrl, opUrlResult);
// //日志记录
// logCtl.info({
// optitle: "阿里云返回的通知url操作文件url下载返回结果",
// op: "/usr/node-dev/OMC/fqboss/app/base/service/impl/trademarkSve.js/opAliNotify",
// content: "请求参数:" + JSON.stringify(pObj) + ",结果信息:" + JSON.stringify(opDownFileResult),
// clientIp: ""
// });
params["returnReceiptUrl"] = opDownFileResult.code == 1 ? opDownFileResult.data.url : pObj.fileUrl;
var opResult = { code: 1, msg: "succeed" };
var updateTmStatus = 0;
try {
await this.db.transaction(async function (t) {
if (item.tmStatus != tmStatus) {
await self.dao.updateByWhere(setParam, { where: { proxyCode: item.proxyCode } }, t);
opResult.msg = "succeed";
opResult.code = 1;
updateTmStatus = 1;
}
if (pObj.applyNo || ["ALIPAPERS2", "RECVCOMMIT", "3", "4", "7", "8", "9", "13"].indexOf(tmStatus) >= 0) {//操作回执
var fileName = official_type_name + "_" + item.tmName + "_" + item.nclOneCodes;
var flowWhere = { where: { tmRegistNum: pObj.applyNo, tmStatus: tmStatus } };
var flowCount = await self.tmflowDao.findCount(flowWhere);
if (flowCount > 0) {
await self.tmflowDao.updateByWhere(params, flowWhere, t);
} else {
await self.tmflowDao.create(params, t);
var params = {
tmStatus: tmStatus,
uploadFileName: fileName,
// returnReceiptUrl: pObj.fileUrl,//TODO:需要下载下来重新保存
tmRegistNum: pObj.applyNo,
};
if (pObj.fileUrl) {
// var opUrlResult = {
// code: 1,
// message: "success",
// data: {}
// };
// var opDownFileResult = await self.opDownFileInfo(pObj.fileUrl, opUrlResult);
// //日志记录
// logCtl.info({
// optitle: "阿里云返回的通知url操作文件url下载返回结果",
// op: "/usr/node-dev/OMC/fqboss/app/base/service/impl/trademarkSve.js/opAliNotify",
// content: "请求参数:" + JSON.stringify(pObj) + ",结果信息:" + JSON.stringify(opDownFileResult),
// clientIp: ""
// });
params["returnReceiptUrl"] = opDownFileResult.code == 1 ? opDownFileResult.data.url : pObj.fileUrl;
}
if (flowCount > 0) {
await self.tmflowDao.updateByWhere(params, flowWhere, t);
} else {
await self.tmflowDao.create(params, t);
}
opResult.msg = "succeed";
opResult.code = 1;
}
opResult.msg = "succeed";
opResult.code = 1;
}
});
// if (opResult.code == 1) {
// self.pushReceiptDingTalkMsg(item.proxyCode, tmStatus, "阿里云商标信息提醒");
// }//发送钉钉消息
});
} catch (error) {
//日志记录
logCtl.error({
optitle: "阿里通知更新状态异常",
op: "/usr/node-dev/OMC/fqboss/app/base/service/impl/trademarkSve.js/opAliNotify",
content: "请求参数:" + JSON.stringify(pObj) + ",error信息:" + e.stack,
clientIp: ""
});
opResult.msg = "failure error";
opResult.code = -110;
}
if (updateTmStatus == 1) {
var msg = "阿里商标申请,阿里业务ID:" + item.businessId + "\n申请人:" + item.applyName + "\n商标名称:" + item.tmName + "\n申请状态变更为:" + official_type_name;
var obj = {
content: msg,
send_msg: "",
is_send: -1,
order_no: item.channelOrderNum
};
self.notifyDingTalkMsg(obj);
}//发送钉钉消息
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