var System=require("../../system");
var settings=require("../../../config/settings");
var pinyin = require("pinyin");
class ichemingCtl{
  constructor(){
    this.ichemingUrl=settings.apiconfig.ichemingUrl();
  }

  async ichemingApi(query,obj){
    var result={};
    var cityname=obj.cityname;
    var keyword=obj.keyword;
    var btname=obj.btname;
    var orgname=obj.orgname;
    var sitcity=obj.sitcity;
    var heming ={
      "cityname":cityname,
      "keyword":keyword,
      "btname":btname,
      "orgname":orgname,
      "sitcity":sitcity
    }
    var url=this.ichemingUrl;
    var rc=System.getObject("util.execClient");
    var rtn=null;
    try{
      rtn=await rc.execPost(heming,url);
      var data=JSON.parse(rtn.stdout);
      console.log("heming++++++++++++++++++++++++++++++++++++++++++++++++++++++");
      console.log(data);
      return System.getResult2(data,null);
    }catch(e){
      console.log(e);
      return System.getResult2(result,null);
    }
    return System.getResult2(result,null);
  }
}
module.exports=ichemingCtl;

// var task = new ichemingCtl();
// task.ichemingApi({
// "cityname":"北京",
// "keyword":"白杨",
// "btname":"管理",
// "orgname":"有限公司",
// "sitcity":2
// }).then(d=>{
//   console.log("ddddddddddddddddddddddddddddddddddddd");
//   console.log(d);
// })
