Commit c3d6743a by 王栋源

wdy

parent 5e5dee1a
...@@ -496,67 +496,77 @@ class ToolCtl { ...@@ -496,67 +496,77 @@ class ToolCtl {
//生成企业监控报告-h5 post //生成企业监控报告-h5 post
async createMonitoringReportH5p(pobj, obj, r) { async createMonitoringReportH5p(pobj, obj, r) {
var key = "create_repotCache" try{
if (!obj.companyname) { var key = "create_repotCache"
return { code: -1, msg: "企业名称参数错误" }; if (!obj.companyname) {
} return { code: -1, msg: "企业名称参数错误" };
obj.companyname = await this.getConvertSemiangleStr(obj.companyname); }
var source = { obj.companyname = await this.getConvertSemiangleStr(obj.companyname);
wxuser_id: obj.wxuser_id, var source = {
companyname: obj.companyname, wxuser_id: obj.wxuser_id,
phonenum: obj.phonenum, companyname: obj.companyname,
email: obj.email, phonenum: obj.phonenum,
notifyUrl: obj.notifyUrl, email: obj.email,
source: obj.appid, notifyUrl: obj.notifyUrl,
push_type:obj.push_type, source: obj.appid,
type: obj.type push_type:obj.push_type,
} type: obj.type
logCtl.info({ }
optitle: "生成企业监控报告-h5", logCtl.info({
op: "tooCtl/createMonitoringReportH5", optitle: "生成企业监控报告-h5",
content: JSON.stringify(obj) + "---------------" + JSON.stringify(source), op: "tooCtl/createMonitoringReportH5",
clientIp: "" content: JSON.stringify(obj) + "---------------" + JSON.stringify(source),
}); clientIp: ""
var search = { companyname: obj.companyname, status: 1, type: obj.type }; });
var info = await this.pytmreportSve.findOne(search); var search = { companyname: obj.companyname, status: 1, type: obj.type };
if (info) { var info = await this.pytmreportSve.findOne(search);
if (obj.push_type == 1) { if (info) {
if (obj.type == 1) { if (obj.push_type == 1) {
var html = '<a href="' + info.filepath + '">企业商标监控报告</a>' if (obj.type == 1) {
this.mailClient.sendMsg(info.email, "企业商标监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom var html = '<a href="' + info.filepath + '">企业商标监控报告</a>'
this.mailClient.sendMsg(info.email, "企业商标监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom
}
if (obj.type == 2) {
var html = '<a href="' + info.filepath + '">企业专利监控报告</a>'
this.mailClient.sendMsg(info.email, "企业专利监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom
}
} }
if (obj.type == 2) { if (obj.push_type == 2) {
var html = '<a href="' + info.filepath + '">企业专利监控报告</a>' var pobj = {
this.mailClient.sendMsg(info.email, "企业专利监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom receiverId: obj.wxuser_id,
title: obj.companyname,
linkUrl: info.filepath
}
var rtn = await this.execClient.execPost(pobj, obj.notifyUrl);
console.log("report------------------------------------------------------------------");
logCtl.info({
optitle: "icompany---------log",
op: "tooCtl/createMonitoringReportH5p",
content: rtn,
clientIp: ""
});
console.log(rtn)
} }
} source.filepath = info.filepath;
if (obj.push_type == 2) { source.status = 1;
var pobj = { await this.pytmreportSve.create(source);
receiverId: obj.wxuser_id, return { code: 1 };
title: obj.companyname, } else {
linkUrl: info.filepath var result = await this.pytmreportSve.create(source);
if (result) {
this.redisClient.rpush(key, result.id);
} }
var rtn = await this.execClient.execPost(pobj, obj.notifyUrl); return { code: 1 };
console.log("report------------------------------------------------------------------");
logCtl.info({
optitle: "icompany---------log",
op: "tooCtl/createMonitoringReportH5p",
content: rtn,
clientIp: ""
});
console.log(rtn)
} }
source.filepath = info.filepath; } catch(e){
source.status = 1; logCtl.info({
await this.pytmreportSve.create(source); optitle: "icompany---------log",
return { code: 1 }; op: "tooCtl/createMonitoringReportH5p--error",
} else { content: rtn,
var result = await this.pytmreportSve.create(source); clientIp: ""
if (result) { });
this.redisClient.rpush(key, result.id);
}
return { code: 1 };
} }
} }
//生成企业专利监控报告-h5 //生成企业专利监控报告-h5
......
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