Commit ec80560a by 王栋源

wdy

parent 5ba25a04
......@@ -444,7 +444,57 @@ class ToolCtl {
//生成企业监控报告-h5
async createMonitoringReportH5(obj){
async createMonitoringReportH5(obj,p,r){
var key="create_tmrepotCache"
if(!obj.companyname){
return {code:-1,msg:"企业名称参数错误"};
}
if(!obj.email){
return {code:-2,msg:"邮箱参数错误"};
}
obj.companyname= await this.getConvertSemiangleStr(obj.companyname);
var source={
companyname:obj.companyname,
phonenum:obj.phonenum,
email:obj.email,
type:1
}
if(obj.entcode){
var ent = await this.companySve.dao.model.findOne({where:{code:obj.entcode,isEnabled:1},raw:true});
if(ent){
source["channel_company_id"]=ent.id;
if(obj.wxuser_id){
source["wxuser_id"]=obj.wxuser_id;
}
}
}
logCtl.info({
optitle: "生成企业监控报告-h5",
op: "tooCtl/createMonitoringReportH5",
content: JSON.stringify(obj)+"---------------"+JSON.stringify(source),
clientIp: ""
});
var search={companyname:obj.companyname,status:1,type:1};
var info=await this.pytmreportSve.findOne(search);
if(info){
var html = '<a href="'+info.filepath+'">企业监控报告</a>'
var result = await this.mailClient.sendMsg(obj.email, "企业监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom
source.filepath=info.filepath;
source.status=1;
await this.pytmreportSve.create(source);
return {code:1};
}else{
var result=await this.pytmreportSve.create(source);
if(result){
this.redisClient.rpush(key,result.id);
}
return {code:1};
}
}
//生成企业监控报告-h5 post
async createMonitoringReportH5p(pobj,obj,r){
var key="create_tmrepotCache"
if(!obj.companyname){
return {code:-1,msg:"企业名称参数错误"};
......
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