const system = require("../../../system");
const ServiceBase = require("../../sve.base")
const settings = require("../../../../config/settings")
class TcompanytaxocrService extends ServiceBase {
  constructor() {
    super("tax", ServiceBase.getDaoName(TcompanytaxocrService));
  }

  async sendImg(limit) {
    let items = await this.dao.findUnSendIds(limit);
    if(!items || items.length == 0) {
      return;
    }

    for(let item of items) {
      let ocr = await this.dao.findById(item.id);
      try {
        // TODO 张云飞接口
        ocr.isSend = true;
        ocr.send_time = new Date();
        await ocr.save();
      } catch (error) {
        console.log(error);
      }
    }
  }
}
module.exports = TcompanytaxocrService;
