Commit 02d00cd6 by 王栋源

wdy

parent ec80560a
...@@ -10,7 +10,8 @@ class TmtransactionApi extends ApiBase { ...@@ -10,7 +10,8 @@ class TmtransactionApi extends ApiBase {
this.utilstmtasktradeSve = System.getObject("service.utilstmtasktradeSve"); this.utilstmtasktradeSve = System.getObject("service.utilstmtasktradeSve");
this.pytmreportSve = System.getObject("service.pytmreportSve"); this.pytmreportSve = System.getObject("service.pytmreportSve");
this.mailClient = System.getObject("util.mailClient"); this.mailClient = System.getObject("util.mailClient");
this.redisClient=System.getObject("util.redisClient"); this.redisClient = System.getObject("util.redisClient");
this.execClient = System.getObject("util.execClient");
}; };
//获取某类型的交易商标 post //获取某类型的交易商标 post
async findByTmType(obj) { async findByTmType(obj) {
...@@ -50,13 +51,20 @@ class TmtransactionApi extends ApiBase { ...@@ -50,13 +51,20 @@ class TmtransactionApi extends ApiBase {
async tmreport() { async tmreport() {
var id = await this.redisClient.lpop("create_tmrepotCache"); var id = await this.redisClient.lpop("create_repotCache");
console.log(id, "商标检索报告执行开始................."); console.log(id, "商标检索报告执行开始.................");
if (id) { if (id) {
var info = await this.pytmreportSve.dao.findById(id); var info = await this.pytmreportSve.dao.findById(id);
console.log(info.dataValues); console.log(info.dataValues);
if (info) { if (info) {
var url = "http://43.247.184.92:8015/tmdoc/api/createdoc?mycompanyname=" + encodeURIComponent(info.companyname); var cpush = "";
if (info.push_type == 1) {
cpush = "http://43.247.184.92:8015/tmdoc/api/createdoc?mycompanyname=";
}
if (info.push_type == 2) {
cpush = "http://43.247.184.94:19500/patentdoc/api/createdoc?mycompanyname=";
}
var url = cpush + encodeURIComponent(info.companyname);
var rc = System.getObject("util.execClient"); var rc = System.getObject("util.execClient");
var rtn = null; var rtn = null;
try { try {
...@@ -66,26 +74,41 @@ class TmtransactionApi extends ApiBase { ...@@ -66,26 +74,41 @@ class TmtransactionApi extends ApiBase {
// console.log("fanhui"); // console.log("fanhui");
console.log(j); console.log(j);
if (j.indexOf("gsb-zc.oss-cn-beijing.aliyuncs.com") >= 0) { if (j.indexOf("gsb-zc.oss-cn-beijing.aliyuncs.com") >= 0) {
var text = "企业监控报告"; if (info.push_type == 1) {
var html = '<a href="' + j + '">企业监控报告</a>' if (info.type == 1) {
var mresult = this.mailClient.sendMsg(info.email, "企业监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom var html = '<a href="' + j + '">企业商标监控报告</a>'
this.mailClient.sendMsg(info.email, "企业商标监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom
}
if (info.type == 2) {
var html = '<a href="' + j + '">企业专利监控报告</a>'
this.mailClient.sendMsg(info.email, "企业专利监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom
}
}
if (info.push_type == 2) {
var pobj = {
fid: info.wxuser_id,
title: info.companyname,
linkUrl: j
}
var rtn = await this.execClient.execPost(pobj, info.notifyUrl);
}
info.dataValues.filepath = j;
info.dataValues.status = 1;
var result = await this.pytmreportSve.dao.model.update(info.dataValues, { where: { id: id } });
logCtl.info({
optitle: "检索报告执行结果",
op: "/igirl-web/app/base/db/task/CreaterepotTask.js",
content: "id=" + id + "执行结果:" + j,
clientIp: ""
});
return result;
} }
info.dataValues.filepath = j;
info.dataValues.status = 1;
var result = await this.pytmreportSve.dao.model.update(info.dataValues, { where: { id: id } });
logCtl.info({
optitle: "商标检索报告执行结果",
op: "/igirl-web/app/base/db/task/CreatetmrepotTask.js",
content: "id=" + id + "执行结果:" + j,
clientIp: ""
});
return result;
} catch (e) { } catch (e) {
console.log(e); console.log(e);
//日志记录 //日志记录
logCtl.error({ logCtl.error({
optitle: "商标检索报告执行结果-error", optitle: "检索报告执行结果-error",
op: "/igirl-web/app/base/db/task/CreatetmrepotTask.js", op: "/igirl-web/app/base/db/task/CreaterepotTask.js",
content: e.stack, content: e.stack,
clientIp: "" clientIp: ""
}); });
......
...@@ -4,19 +4,22 @@ module.exports = (db, DataTypes) => { ...@@ -4,19 +4,22 @@ module.exports = (db, DataTypes) => {
filepath: DataTypes.STRING, filepath: DataTypes.STRING,
phonenum: DataTypes.STRING, phonenum: DataTypes.STRING,
email: DataTypes.STRING, email: DataTypes.STRING,
status:DataTypes.INTEGER, status: DataTypes.INTEGER,
type:DataTypes.INTEGER, type: DataTypes.INTEGER,
channel_company_id:DataTypes.INTEGER,//统计公司id(通过公司渠道码获取,用于渠道用户统计使用商标报告功能情况) channel_company_id: DataTypes.INTEGER,//统计公司id(通过公司渠道码获取,用于渠道用户统计使用商标报告功能情况)
wxuser_id:DataTypes.INTEGER //微信用户id(使用商标报告功能的微信用户id,存在于wx_user表中) wxuser_id: DataTypes.INTEGER, //微信用户id(使用商标报告功能的微信用户id,存在于wx_user表中)
},{ notifyUrl: DataTypes.STRING,
paranoid: true,//假的删除 source: DataTypes.STRING,
underscored: true, push_type: DataTypes.STRING,
version: true, }, {
freezeTableName: true, paranoid: true,//假的删除
//freezeTableName: true, underscored: true,
// define the table's name version: true,
tableName: 'py_tmreport', freezeTableName: true,
validate: { //freezeTableName: true,
} // define the table's name
}); tableName: 'py_tmreport',
validate: {
}
});
} }
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