import Common from '../../common/Common.js';

/**
 * 工具类自动生成的API，请勿做任何修改，请勿做任何修改，请勿做任何修改（重要的事情说3遍）
 * 工具作者: 杨志杰
 * AssetInstanceResource******************************************END********************************************************** 
 */
export default {

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 新增资产. 
   */
  addAsset: function (assetDto) {
    var requestUrl = 'AssetInstanceResource/addAsset';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据id查找资产卡片 
   */
  assetInstanceRecipientsToReturn: function (epc, userId, imageSrc, position) {
    var requestUrl = 'AssetInstanceResource/assetInstanceRecipientsToReturn';
    var paramCount = 0;
    if (epc != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('epc=' + epc);
      paramCount++;
    }
    if (userId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('userId=' + userId);
      paramCount++;
    }
    if (imageSrc != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('imageSrc=' + imageSrc);
      paramCount++;
    }
    if (position != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('position=' + position);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 资产卡片搜索 
   */
  assetInstanceSearch: function (queryParam) {
    var requestUrl = 'AssetInstanceResource/assetInstanceSearch';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(queryParam),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 固定资产查询. 
   */
  assetSearch: function (condition, length, start) {
    var requestUrl = 'AssetInstanceResource/assetSearch';

    var formData = {};
    if (condition != null) {
      formData.condition = condition;
    }
    if (length != null) {
      formData.length = length;
    }
    if (start != null) {
      formData.start = start;
    }

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',



        data: formData,
        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 固定资产注册查询. 
   */
  assetSearchNoPrint: function (condition, length, start, isPrinted) {
    var requestUrl = 'AssetInstanceResource/assetSearchNoPrint';
    var paramCount = 0;
    if (condition != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('condition=' + condition);
      paramCount++;
    }
    if (length != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('length=' + length);
      paramCount++;
    }
    if (start != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('start=' + start);
      paramCount++;
    }
    if (isPrinted != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('isPrinted=' + isPrinted);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产卡片编码查询是否有此资产卡片编码 
   */
  byBarCode: function (byBarCode) {
    var requestUrl = 'AssetInstanceResource/byBarCode';
    var paramCount = 0;
    if (byBarCode != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('byBarCode=' + byBarCode);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 盘点 
   */
  check: function (assetInstanceIds, checkId, locationId) {
    var requestUrl = 'AssetInstanceResource/check';

    var formData = {};
    if (assetInstanceIds != null) {
      formData.assetInstanceIds = assetInstanceIds;
    }
    if (checkId != null) {
      formData.checkId = checkId;
    }
    if (locationId != null) {
      formData.locationId = locationId;
    }

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',



        data: formData,
        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 清空待搜索的资产卡片 
   */
  delectAssetSearch: function () {
    var requestUrl = 'AssetInstanceResource/delectAssetSearch';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据ID删除资产卡片(只删除资产卡片)App功能 
   */
  deleteAssetInstance: function (assetInstanceId) {
    var requestUrl = 'AssetInstanceResource/deleteAssetInstance';
    var paramCount = 0;
    if (assetInstanceId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('assetInstanceId=' + assetInstanceId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据assetInstanceId删除对应资产 
   */
  deleteById: function (assetInstanceId) {
    var requestUrl = 'AssetInstanceResource/deleteById';
    var paramCount = 0;
    if (assetInstanceId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('assetInstanceId=' + assetInstanceId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 导出资产卡片清单数据 
   */
  exportAssetInstanceData: function (queryParam) {
    var requestUrl = 'AssetInstanceResource/exportAssetData';

    var formData = {};
    if (queryParam != null) {
      formData.queryParam = queryParam;
    }

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',



        data: formData,
        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产卡片Id查询资产卡片详细信息。 
   */
  findAssetInstanceById: function (assetInstanceId) {
    var requestUrl = 'AssetInstanceResource/findAssetInstanceById';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetInstanceId),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 模糊查询车辆类资产卡片 
   */
  findAssetInstanceDto: function (start, length, searchString, systemCode) {
    var requestUrl = 'AssetInstanceResource/findAssetInstanceDto';
    var paramCount = 0;
    if (start != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('start=' + start);
      paramCount++;
    }
    if (length != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('length=' + length);
      paramCount++;
    }
    if (searchString != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('searchString=' + searchString);
      paramCount++;
    }
    if (systemCode != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('systemCode=' + systemCode);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产卡片生成资产 
   */
  generateAssetByAssetInstance: function () {
    var requestUrl = 'AssetInstanceResource/generateAssetByAssetInstance';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 通过二维码查询固定资产实例 
   */
  getAssetByBarCode: function (barCode, loginClientAssetInstance) {
    var requestUrl = 'AssetInstanceResource/getAssetByBarCode';
    var paramCount = 0;
    if (barCode != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('barCode=' + barCode);
      paramCount++;
    }
    if (loginClientAssetInstance != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('loginClientAssetInstance=' + loginClientAssetInstance);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 通过EPC编码查询固定资产实例 
   */
  getAssetByEpc: function (epc) {
    var requestUrl = 'AssetInstanceResource/getAssetByEpc';
    var paramCount = 0;
    if (epc != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('epc=' + epc);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据ID查询资产. 
   */
  getAssetById: function (assetId) {
    var requestUrl = 'AssetInstanceResource/getAssetById';
    var paramCount = 0;
    if (assetId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('assetId=' + assetId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询一定时间内和存放地点所有读写器记录的资产 
   */
  getAssetByTime: function (startTime, endTime, locationId) {
    var requestUrl = 'AssetInstanceResource/getAssetByTime';
    var paramCount = 0;
    if (startTime != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('startTime=' + startTime);
      paramCount++;
    }
    if (endTime != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('endTime=' + endTime);
      paramCount++;
    }
    if (locationId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('locationId=' + locationId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产EPC查询资产图片 
   */
  getAssetImageInfosByEpc: function (epc, start, length, startDate, endDate) {
    var requestUrl = 'AssetInstanceResource/getAssetImageInfosByEpc';

    var formData = {};
    if (epc != null) {
      formData.epc = epc;
    }
    if (start != null) {
      formData.start = start;
    }
    if (length != null) {
      formData.length = length;
    }
    if (startDate != null) {
      formData.startDate = startDate;
    }
    if (endDate != null) {
      formData.endDate = endDate;
    }

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',

        dataType: 'json',

        data: formData,
        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 扫描二维码查询资产卡片 
   */
  getAssetInstanceByBarCode: function (barcode) {
    var requestUrl = 'AssetInstanceResource/getAssetInstanceByBarCode';
    var paramCount = 0;
    if (barcode != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('barcode=' + barcode);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 通过二维码查询固定资产卡片(盘点用) 
   */
  getAssetInstanceByBarCodeForInventory: function (barCode) {
    var requestUrl = 'AssetInstanceResource/getAssetInstanceByBarCodeForInventory';
    var paramCount = 0;
    if (barCode != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('barCode=' + barCode);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 通过epc查询资产卡片(盘点用) 
   */
  getAssetInstanceByEpcForInventory: function (epcs) {
    var requestUrl = 'AssetInstanceResource/getAssetInstanceByEpcForInventory';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(epcs),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产epc获取资产 
   */
  getAssetInstanceByEpcList: function (assetInstanceQueryParam) {
    var requestUrl = 'AssetInstanceResource/getAssetInstanceByEpcList';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetInstanceQueryParam),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询该单位下所有资产卡片 
   */
  getAssetInstanceByMaxId: function (maxId) {
    var requestUrl = 'AssetInstanceResource/getAssetInstanceByMaxId';
    var paramCount = 0;
    if (maxId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('maxId=' + maxId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 获取资产清单ForApp 
   */
  getAssetList: function (param) {
    var requestUrl = 'AssetInstanceResource/getAssetList';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(param),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据部门和分类查询资产 
   */
  getByOrganizationAndCategory: function (queryParam) {
    var requestUrl = 'AssetInstanceResource/getByOrganizationAndCategory';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(queryParam),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 通过二维码查询固定资产卡片(车辆管理使用) 
   */
  getCarAssetInstanceByBarCode: function (barCode) {
    var requestUrl = 'AssetInstanceResource/getCarAssetInstanceByBarCode';
    var paramCount = 0;
    if (barCode != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('barCode=' + barCode);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据单位Id查询资产实例分类统计信息 
   */
  getCategoryStatistics: function (clientId) {
    var requestUrl = 'AssetInstanceResource/getCategoryStatistics';

    var formData = {};
    if (clientId != null) {
      formData.clientId = clientId;
    }

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',

        dataType: 'json',

        data: formData,
        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询资产实例分类统计信息 
   */
  getCategoryStatisticsNew: function (statisticsQueryDto) {
    var requestUrl = 'AssetInstanceResource/getCategoryStatisticsNew';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',


        data: JSON.stringify(statisticsQueryDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据单位和月份查询保养统计数据 
   */
  getCategoryStatisticsNew2: function (paramDto) {
    var requestUrl = 'AssetInstanceResource/getCategoryStatisticsNew2';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(paramDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询计量单位 
   */
  getComputationUnit: function () {
    var requestUrl = 'AssetInstanceResource/getComputationUnit';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询生命周期 
   */
  getHistoryEvent: function (assetInstanceId) {
    var requestUrl = 'AssetInstanceResource/getHistoryEvent';
    var paramCount = 0;
    if (assetInstanceId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('assetInstanceId=' + assetInstanceId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询对应资产抓拍照片 
   */
  getImageUrlByAsset: function (assetEpc, readerResultId) {
    var requestUrl = 'AssetInstanceResource/getImageUrlByAsset';
    var paramCount = 0;
    if (assetEpc != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('assetEpc=' + assetEpc);
      paramCount++;
    }
    if (readerResultId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('readerResultId=' + readerResultId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询资产新增统计数据 
   */
  getIncreaseStatistics: function (startDate, endDate) {
    var requestUrl = 'AssetInstanceResource/getIncreaseStatistics';

    var formData = {};
    if (startDate != null) {
      formData.startDate = startDate;
    }
    if (endDate != null) {
      formData.endDate = endDate;
    }

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',



        data: formData,
        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询资产新增统计数据New 
   */
  getIncreaseStatisticsNew: function (statisticsQueryDto) {
    var requestUrl = 'AssetInstanceResource/getIncreaseStatisticsNew';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',


        data: JSON.stringify(statisticsQueryDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据选择的单位和月份查询保养统计数据 
   */
  getIncreaseStatisticsNew1: function (paramDto) {
    var requestUrl = 'AssetInstanceResource/getIncreaseStatisticsNew1';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(paramDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据单位和月份查询保养统计数据 
   */
  getIncreaseStatisticsNew2: function (paramDto) {
    var requestUrl = 'AssetInstanceResource/getIncreaseStatisticsNew2';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(paramDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   *  
   */
  getNoAssetNo: function () {
    var requestUrl = 'AssetInstanceResource/getNoAssetNo';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据单位Id查询资产实例部门统计信息 
   */
  getOrganizationStatistics: function (clientId) {
    var requestUrl = 'AssetInstanceResource/getOrganizationStatistics';

    var formData = {};
    if (clientId != null) {
      formData.clientId = clientId;
    }

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',



        data: formData,
        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询资产部门统计 
   */
  getOrganizationStatisticsNew: function (statisticsQueryDto) {
    var requestUrl = 'AssetInstanceResource/getOrganizationStatisticsNew';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',


        data: JSON.stringify(statisticsQueryDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产epc获取查询屏蔽的资产 
   */
  getShieldDatas: function (assetInstanceQueryParam) {
    var requestUrl = 'AssetInstanceResource/getShieldDatas';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetInstanceQueryParam),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询资产使用状况统计 
   */
  getStatusOfUseStatisticsNew: function (statisticsQueryDto) {
    var requestUrl = 'AssetInstanceResource/getStatusOfUseStatisticsNew';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',


        data: JSON.stringify(statisticsQueryDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据用户id查询用户借出归还结果 
   */
  getStockOutOrInResultByUserId: function (userId) {
    var requestUrl = 'AssetInstanceResource/getStockOutOrInResultByUserId';
    var paramCount = 0;
    if (userId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('userId=' + userId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 待搜索资产卡片中添加资产卡片 
   */
  insertAssetSearch: function (assetInstanceId) {
    var requestUrl = 'AssetInstanceResource/insertAssetSearch';
    var paramCount = 0;
    if (assetInstanceId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('assetInstanceId=' + assetInstanceId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询登陆单位下所有资产卡片 
   */
  listAssetInstance: function () {
    var requestUrl = 'AssetInstanceResource/getAssetInstance';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据条件查询可访问部门的资产DTO 
   */
  listByAssetQueryParamDto: function (param) {
    var requestUrl = 'AssetInstanceResource/listByAssetQueryParamDto';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(param),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 通过二维码查询固定资产实例 
   */
  listSimpleByBarCode: function (barCode) {
    var requestUrl = 'AssetInstanceResource/listSimpleByBarCode';
    var paramCount = 0;
    if (barCode != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('barCode=' + barCode);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询未打印的资产卡片的数量 
   */
  noPrintAssetCount: function () {
    var requestUrl = 'AssetInstanceResource/noPrintAssetInstanceCount';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询未打印的资产卡片 
   */
  noPrintAssetInstance: function (start, length, searchString, isPrinted, addSelectCondition) {
    var requestUrl = 'AssetInstanceResource/noPrintAssetInstance';
    var paramCount = 0;
    if (start != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('start=' + start);
      paramCount++;
    }
    if (length != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('length=' + length);
      paramCount++;
    }
    if (searchString != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('searchString=' + searchString);
      paramCount++;
    }
    if (isPrinted != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('isPrinted=' + isPrinted);
      paramCount++;
    }
    if (addSelectCondition != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('addSelectCondition=' + addSelectCondition);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * ********************************betweet***************************************************生成图片库 
   */
  plistDownLoad: function () {
    var requestUrl = 'AssetInstanceResource/plistDownLoad';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/x-www-form-urlencoded',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产卡片Id打印资产卡片 V2.0 
   */
  print: function (assetInstanceIds) {
    var requestUrl = 'AssetInstanceResource/print';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetInstanceIds),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 打印档案 
   */
  printArchivesByAssetInstanceId: function (token, recordIds) {
    var requestUrl = 'AssetInstanceResource/printArchivesByAssetInstanceId';
    var paramCount = 0;
    if (token != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('token=' + token);
      paramCount++;
    }
    if (recordIds != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('recordIds=' + recordIds);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'text',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询已打印的资产卡片的数量 
   */
  printAssetCount: function () {
    var requestUrl = 'AssetInstanceResource/printAssetInstanceCount';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * RFID领用报表 
   */
  printAssetInstanceStockIn: function (recordId) {
    var requestUrl = 'AssetInstanceResource/printAssetInstanceStockIn';
    var paramCount = 0;
    if (recordId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('recordId=' + recordId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * RFID归还报表 
   */
  printAssetInstanceStockOut: function (recordId) {
    var requestUrl = 'AssetInstanceResource/printAssetInstanceStockOut';
    var paramCount = 0;
    if (recordId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('recordId=' + recordId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产卡片Id打印资产卡片 V1.0 
   */
  printByAssetId: function (token, recordIds) {
    var requestUrl = 'AssetInstanceResource/printByAssetInstanceId';
    var paramCount = 0;
    if (token != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('token=' + token);
      paramCount++;
    }
    if (recordIds != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('recordIds=' + recordIds);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'text',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据资产实例Id打印二维码 
   */
  printByAssetInstanceId: function (assetInstanceId) {
    var requestUrl = 'AssetInstanceResource/printAssetInstanceById';

    var formData = {};
    if (assetInstanceId != null) {
      formData.assetInstanceId = assetInstanceId;
    }

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',

        dataType: 'json',

        data: formData,
        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询所有的资产. 
   */
  queryAllAssetDtos: function (start, length, searchString) {
    var requestUrl = 'AssetInstanceResource/queryAllAssetDtos';
    var paramCount = 0;
    if (start != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('start=' + start);
      paramCount++;
    }
    if (length != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('length=' + length);
      paramCount++;
    }
    if (searchString != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('searchString=' + searchString);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 查询集团公司下所有的资产卡片 
   */
  queryAssetInstanceByClient: function () {
    var requestUrl = 'AssetInstanceResource/queryAssetInstanceByClient';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',

        dataType: 'json',


        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据epc和是否显示不识别参数查询固定资产 
   */
  queryAssetInstanceByEpcs: function (organizationAssetQueryDto) {
    var requestUrl = 'AssetInstanceResource/queryAssetInstanceByEpcs';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(organizationAssetQueryDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据添加人和公司查询待搜索中的资产卡片 
   */
  queryAssetSearchByUser: function () {
    var requestUrl = 'AssetInstanceResource/queryAssetSearchByUser';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据epc集合查询资产集合 
   */
  queryByEpcSet: function (assetInstanceDtos) {
    var requestUrl = 'AssetInstanceResource/queryByEpcSet';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetInstanceDtos),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 设置打印模板 
   */
  queryYearlyWork: function (assetInstanceId, templateId) {
    var requestUrl = 'AssetInstanceResource/setPrintTemplate';
    var paramCount = 0;
    if (assetInstanceId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('assetInstanceId=' + assetInstanceId);
      paramCount++;
    }
    if (templateId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('templateId=' + templateId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 添加资产. 
   */
  sava: function (assetDto) {
    var requestUrl = 'AssetInstanceResource/save';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',


        data: JSON.stringify(assetDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 保存资产编号. 
   */
  saveNoAssetNo: function (assetDtos) {
    var requestUrl = 'AssetInstanceResource/saveNoAssetNo';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',


        data: JSON.stringify(assetDtos),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * RFID归还 
   */
  stockIn: function (assetStockDto) {
    var requestUrl = 'AssetInstanceResource/stockIn';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetStockDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * RFID领用归还 
   */
  stockInForSZWL: function (assetStockDto) {
    var requestUrl = 'AssetInstanceResource/stockInForSZWL';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetStockDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * RFID领用 
   */
  stockOut: function (assetStockDto) {
    var requestUrl = 'AssetInstanceResource/stockOut';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetStockDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * RFID领用 
   */
  stockOutForSZWL: function (assetStockDto) {
    var requestUrl = 'AssetInstanceResource/stockOutForSZWL';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetStockDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 根据id查找资产卡片 
   */
  uniqueAssetInstance: function (assetInstanceId) {
    var requestUrl = 'AssetInstanceResource/uniqueAssetInstance';
    var paramCount = 0;
    if (assetInstanceId != null) {
      requestUrl += (paramCount > 0) ? '&' : '?';
      requestUrl += ('assetInstanceId=' + assetInstanceId);
      paramCount++;
    }


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'get',
        contentType: 'application/json',




        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 修改资产信息. 
   */
  updateAsset: function (assetDto) {
    var requestUrl = 'AssetInstanceResource/updateAsset';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 扫描上传资产卡片图片 
   */
  updateImageName: function (assetInstanceDto) {
    var requestUrl = 'AssetInstanceResource/updateImageName';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetInstanceDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 扫描上传资产卡片其他图片 
   */
  updateOtherImages: function (assetInstanceDto) {
    var requestUrl = 'AssetInstanceResource/updateOtherImages';


    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetInstanceDto),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },

  /**
   * 工具类自动生成的方法
   * 工具作者: 杨志杰
   * 资产卡片复制
   */
  copy: function (assetInstanceCopyRequest) {
    var requestUrl = 'AssetInstanceResource/copy';

    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL(requestUrl),
        type: 'post',
        contentType: 'application/json',

        dataType: 'json',
        data: JSON.stringify(assetInstanceCopyRequest),

        beforeSend: function (request) {
          Common.addTokenToRequest(request);
        },
        success: function (data) {
          resolve(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },
};
