const system = require("../../../system");
const ServiceBase = require("../../sve.base")
const settings = require("../../../../config/settings")
const moment = require("moment");
class IborderbaseService extends ServiceBase {
  constructor() {
    super("order", ServiceBase.getDaoName(IborderbaseService));
    this.regorderSve = system.getObject("service.order.iborderSve");
    this.dkorderSve = system.getObject("service.order.iborderdkSve");
    this.dzorderSve = system.getObject("service.order.iborderdzSve");
  }

  async apiAdd(params) {
    try {
      // 1注册订单 2代开订单 3代账订单
      if (params.productType == 1) {
        return regorderSve.apiAdd(params);
      } else if (params.productType == 2) {
        return dkorderSve.apiAdd(params);
      } else if (params.productType == 3) {
        return dzorderSve.apiAdd(params);
      }
      return await this.add(params);
    } catch (error) {
      console.log(error);
      return system.getResult(null, "接口异常");
    }
  }
}
module.exports = IborderbaseService;
// var task=new UserService();
// task.getUserStatisticGroupByApp().then(function(result){
//   console.log((result));
// }).catch(function(e){
//   console.log(e);
// });