const TaskBase = require("../../task.base");
const system = require("../../../system");
var settings = require("../../../../config/settings");
class Taskigorder2fq extends TaskBase {
  constructor() {
    super(TaskBase.getServiceName(Taskigorder2fq));
    this.restclient = system.getObject("util.restClient");
    this.igirlWeburl = settings.igirlWeburl();
  }
  async beforeTask(params) {
    console.log("前置操作......", this.serviceName);
    //this.isThrough=true; 
    //console.log(this.cacheManager);
  }
  async subDoTask() {
    console.log("--------------");
    console.log("TestTask1.....");
    var obj = {
      "actionType": "Taskigorder2fq",
      "actionBody": {
        "limit": 100 //推送数据条数 默认100条
      }
    }
    try {
      var url = this.igirlWeburl + "api/task/pushOrderInfo2Fq";
      var rtn = await this.restclient.execPost(obj, url);
      console.log(rtn);
      return rtn;
    } catch (error) {
      console.log(error);
      return null;
    }
  }
}
module.exports = Taskigorder2fq;