Commit 9eb7c083 by 宋毅

tj

parent 643fba61
......@@ -19,9 +19,9 @@ class ToolApi extends ApiBase {
this.cacheManager = System.getObject("db.common.cacheManager");
this.appKeyStr = "wx76a324c5d201d1a4";
this.mailClient = System.getObject("util.mailClient");
this.redisClient=System.getObject("util.redisClient");
this.redisClient = System.getObject("util.redisClient");
}
async getUidStr(len, radix) {
async getUidStr(len, radix) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
var uuid = [], i;
radix = radix || chars.length;
......@@ -122,7 +122,7 @@ class ToolApi extends ApiBase {
return { path: '/tmp/' + fileName + '.xlsx', name: fileName + '.xlsx' };
}
//智能分析 bycquerytm.html
async bycznfx(pobj,obj, req) {
async bycznfx(pobj, obj, req) {
var url = obj.url;
if (!url) {
return { code: -1, mag: "文件地址为空" }
......@@ -142,9 +142,9 @@ class ToolApi extends ApiBase {
});
console.log(r.url);
// return { code: 1, data: r };
if(r.url){
return System.getResultSuccess(r.url,null);
}else{
if (r.url) {
return System.getResultSuccess(r.url, null);
} else {
return System.getResultFail(-199, "计算通过率失败");
}
} else {
......@@ -156,7 +156,7 @@ class ToolApi extends ApiBase {
}
}
//文字转图片
async word2pic(pobj,o, req) {
async word2pic(pobj, o, req) {
// var app = req.session.app;
var fs = 180;
if (o.word && o.word.length > 1) {
......@@ -180,7 +180,7 @@ class ToolApi extends ApiBase {
}
}
//图片彩色转黑白
async toblack(o, req) {
async toblack(query, o, req) {
var app = req.session.app;
var obj = {
"appKey": this.appKeyStr,
......@@ -199,7 +199,7 @@ class ToolApi extends ApiBase {
}
}
//调整商标图样宽高
async adjustTMSize(o, req) {
async adjustTMSize(query, o, req) {
var app = req.session.app;
var obj = {
"appKey": this.appKeyStr,
......@@ -218,7 +218,7 @@ class ToolApi extends ApiBase {
}
}
//创建委托书
async createWTS(o, req) {
async createWTS(query, o, req) {
// var app = req.session.app;
var obj = {
"appKey": this.appKeyStr,
......@@ -228,7 +228,7 @@ class ToolApi extends ApiBase {
return result;
}
//营业执照、身份证明图片转pdf
async pic2pdf(pobj,o, req) {
async pic2pdf(pobj, o, req) {
// var app = req.session.app;
var obj = {
"appKey": this.appKeyStr,
......@@ -248,7 +248,7 @@ class ToolApi extends ApiBase {
}
}
//调整委托书大小
async adjustWTSSize(pobj,o, req) {
async adjustWTSSize(pobj, o, req) {
// var app = req.session.app;
var obj = {
"appKey": this.appKeyStr,
......@@ -267,7 +267,7 @@ class ToolApi extends ApiBase {
}
}
//通过名字查询尼斯信息
async getNclByLikeName(o, req) {
async getNclByLikeName(query, o, req) {
var obj = {
"name": o.name,
"appKey": this.appKeyStr
......@@ -276,7 +276,7 @@ class ToolApi extends ApiBase {
return result;
}
async getNcl(o,queryobj, req) {
async getNcl(o, queryobj, req) {
var that = this;
var appkey = this.appKeyStr;
var result = { rows: [], count: 0 };
......@@ -317,7 +317,7 @@ class ToolApi extends ApiBase {
}
return System.getResult2(result, null);
}
async getCompanyInfoByLikeName(oo, o, req) {
async getCompanyInfoByLikeName(query, o, req) {
var appkey = this.appKeyStr;
var data = {
appKey: appkey,
......@@ -333,7 +333,7 @@ class ToolApi extends ApiBase {
}
}
async getEntregistryByCompanyName(pobj,o, req) {
async getEntregistryByCompanyName(pobj, o, req) {
var appkey = this.appKeyStr;
var data = {
appKey: appkey,
......@@ -350,7 +350,7 @@ class ToolApi extends ApiBase {
}
//数据中心工商模糊查询接口
async getCompanyListByVague(pobj,o, req) {
async getCompanyListByVague(query, pobj, req) {
var appkey = this.appKeyStr;
var pageSize = pobj.pageSize ? pobj.pageSize : 20;
var currentPage = pobj.currentPage ? pobj.currentPage : 1;
......@@ -369,7 +369,7 @@ class ToolApi extends ApiBase {
}
//公司详情信息
async getDetailByCompanyName(pobj,o, req) {
async getDetailByCompanyName(query, pobj, req) {
var appkey = this.appKeyStr;
var data = {
appKey: appkey,
......@@ -384,7 +384,7 @@ class ToolApi extends ApiBase {
}
//企业变更记录查询
async getCompanyChangeByName(pobj,o, req) {
async getCompanyChangeByName(query, pobj, req) {
var appkey = this.appKeyStr;
var pageSize = pobj.pageSize ? o.pageSize : 20;
var currentPage = pobj.currentPage ? pobj.currentPage : 1;
......@@ -402,7 +402,7 @@ class ToolApi extends ApiBase {
}
}
//企业ICP证照数据
async getCompanyIcpByName(pobj,o, req) {
async getCompanyIcpByName(query, pobj, req) {
var appkey = this.appKeyStr;
var pageSize = pobj.pageSize ? pobj.pageSize : 20;
var currentPage = pobj.currentPage ? pobj.currentPage : 1;
......@@ -420,7 +420,7 @@ class ToolApi extends ApiBase {
}
}
//商标尼斯小项查询过滤
async getTmNclFilterSearch(pobj,o, req) {
async getTmNclFilterSearch(query, pobj, req) {
var appkey = this.appKeyStr;
var data = {
appKey: appkey,
......@@ -456,7 +456,7 @@ class ToolApi extends ApiBase {
fs.unlink(filePath, e => {
console.log("fail");
});
return System.getResultSuccess(result.url,null);
return System.getResultSuccess(result.url, null);
} else {
return System.getResultFail(-100, "获取图片地址失败");
......@@ -468,7 +468,7 @@ class ToolApi extends ApiBase {
}
}
//标准商标图样上传(生成黑白商标,调整商标宽高 使其合规)
async uploadStandardTm(pobj,o, req) {
async uploadStandardTm(pobj, o, req) {
// var app = req.session.app;
var obj = {
"appKey": this.appKeyStr,
......@@ -483,7 +483,7 @@ class ToolApi extends ApiBase {
var j = await this.imghandleApi.uploadStandardTm(obj);
return j;
} catch (e) {
console.log(e.stack,"uploadStandardTm...........................");
console.log(e.stack, "uploadStandardTm...........................");
return System.getResult2(null, null);
}
}
......@@ -502,34 +502,34 @@ class ToolApi extends ApiBase {
}
//生成企业监控报告
async createMonitoringReport(obj){
async createMonitoringReport(obj) {
var mycompanyname = obj.companyname;
var email = obj.email;
if(!mycompanyname){
return {code:-1,msg:"企业名称参数错误"};
if (!mycompanyname) {
return { code: -1, msg: "企业名称参数错误" };
}
mycompanyname= await this.getConvertSemiangleStr(mycompanyname);
if(!email){
return {code:-2,msg:"邮箱参数错误"};
mycompanyname = await this.getConvertSemiangleStr(mycompanyname);
if (!email) {
return { code: -2, msg: "邮箱参数错误" };
}
var url = "http://43.247.184.92:8015/tmdoc/api/createdoc?mycompanyname="+encodeURIComponent(mycompanyname);
var url = "http://43.247.184.92:8015/tmdoc/api/createdoc?mycompanyname=" + encodeURIComponent(mycompanyname);
var rc = System.getObject("util.execClient");
var rtn = null;
try {
rc.execGet({}, url).then(rtn=>{
rc.execGet({}, url).then(rtn => {
var j = rtn.stdout;
console.log("fanhui");
console.log(j);
if(j.indexOf("gsb-zc.oss-cn-beijing.aliyuncs.com")>=0){
var text="企业监控报告";
var html = '<a href="'+j+'">企业监控报告</a>'
if (j.indexOf("gsb-zc.oss-cn-beijing.aliyuncs.com") >= 0) {
var text = "企业监控报告";
var html = '<a href="' + j + '">企业监控报告</a>'
var result = this.mailClient.sendMsg(email, "企业监控报告", null, html, null, null, []); //发送成功后result的值:250 Data Ok: queued as freedom
}
})
return {code:1};
return { code: 1 };
} catch (e) {
console.log(e);
return {code:-200,msg:"操作失败"};
return { code: -200, msg: "操作失败" };
}
}
......@@ -546,7 +546,7 @@ class ToolApi extends ApiBase {
}
return result;
}
async getOssConfig(){
async getOssConfig() {
return this.uploadApi.getOssConfig();
}
}
......
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