var system = require("../../../system")
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");
var moment = require("moment");
class NotarizationflowCtl extends CtlBase {
  constructor() {
    super("transfer", CtlBase.getServiceName(NotarizationflowCtl));
    //this.appS=system.getObject("service.appSve");
  }

 //首次加载
  async firstload(p, q) {
    var notarinfo = await this.service.firstload(p);
    return notarinfo;
  }

//提交阿里
  async submitali(p, q, req) {
    var notarinfo = p;
    if (notarinfo) {
      var rtn = await this.service.update(notarinfo);
      if (rtn) {
        var alirtn = await this.service.setfiletoali(notarinfo);
        if (alirtn) {
          return { data: alirtn, status: 0, msg: "提交成功" }
        }else{
          return { data: null, status: -202, msg: "提交失败" }
        }
      }else{
        return { data: null, status: -201, msg: "保存失败" }
      }
    }else{
      return { data: null, status: -200, msg: "参数异常" }
    }

  }



}
module.exports = NotarizationflowCtl;
