/**
 * 工具类自动生成的API，请勿做任何修改，请勿做任何修改，请勿做任何修改（重要的事情说3遍）
 * 工具作者: 杨志杰
 * 盘点单资源 
 */
 var AssetInventoryResource = {

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 盘点 
	 */
	check: function(saveInventoryDto){
		var requestUrl = "assetInventoryResource/check";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(saveInventoryDto),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 根据所属部门、使用部门、资产类别查询资产生成资产盘点明细 
	 */
	generateAssetInventoryLineByOrganizationAndCategory: function(queryParam){
		var requestUrl = "assetInventoryResource/generateAssetInventoryLineByOrganizationAndCategory";


		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);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 获取资产盘点的统计数据 <br>
x1 盘点单 (全部) x2 盘点单 (已完成) x3 盘点单 (未完成) 
	 */
	getAssetInventoryStastic: function(tabQueryParam){
		var requestUrl = "assetInventoryResource/getAssetInventoryStastic";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "text",
				data: JSON.stringify(tabQueryParam),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 获取资产盘点进度 
	 */
	getInventoryProgress: function(tabQueryParam){
		var requestUrl = "assetInventoryResource/getInventoryProgress";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "text",
				data: JSON.stringify(tabQueryParam),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 获取盘点单中已经选择的所属部门,使用部门,资产类别 
	 */
	getResponseOrganizationsAndOrganizationsAndCategory: function(assetInventoryId){
		var requestUrl = "assetInventoryResource/getResponseOrganizationsAndOrganizationsAndCategory";
		var paramCount = 0;
		if(assetInventoryId != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('assetInventoryId=' + assetInventoryId);
			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查询盘点单 
	 */
	list: function(range){
		var requestUrl = "assetInventoryResource/list";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(range),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 查询本公司的盘点单 
	 */
	listAssetInventory: function(start, length, searchString){
		var requestUrl = "assetInventoryResource/listAssetInventory";
		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",
				
				dataType: "json",
				
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 离线盘点数据上传 
	 */
	offlineInventoryDataUpload: function(saveInventoryDto){
		var requestUrl = "assetInventoryResource/offlineInventoryDataUpload";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(saveInventoryDto),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 根据盘点单id查询盘点主表信息 
	 */
	queryById: function(assetInventoryId){
		var requestUrl = "assetInventoryResource/queryById";
		var paramCount = 0;
		if(assetInventoryId != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('assetInventoryId=' + assetInventoryId);
			paramCount ++;
		}


		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);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 新增/更新盘点单 
	 */
	save: function(assetInventoryDto){
		var requestUrl = "assetInventoryResource/save";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(assetInventoryDto),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 静态盘点数据处理 
	 */
	staticInventory: function(dto){
		var requestUrl = "assetInventoryResource/staticInventory";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				
				data: JSON.stringify(dto),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	}
}
