87 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			87 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
| using BLL;
 | ||
| using System;
 | ||
| using System.Web.Http;
 | ||
| 
 | ||
| namespace WebAPI.Controllers
 | ||
| {
 | ||
|     /// <summary>
 | ||
|     /// 物资出门申请
 | ||
|     /// </summary>
 | ||
|     public class GoodsManageController : ApiController
 | ||
|     {
 | ||
|         #region 根据主键获取物质出门详细信息
 | ||
|         /// <summary>
 | ||
|         /// 根据主键获取物质出门详细信息
 | ||
|         /// </summary>
 | ||
|         /// <param name="id">主键</param>
 | ||
|         /// <returns>物质出门详细</returns>
 | ||
|         public Model.ResponeData getGoodsManageById(string id)
 | ||
|         {
 | ||
|             var responeData = new Model.ResponeData();
 | ||
|             try
 | ||
|             {
 | ||
|                 responeData.data = APIGoodsManageService.getGoodsManageById(id);
 | ||
|             }
 | ||
|             catch (Exception ex)
 | ||
|             {
 | ||
|                 responeData.code = 0;
 | ||
|                 responeData.message = ex.Message;
 | ||
|             }
 | ||
| 
 | ||
|             return responeData;
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 根据projectId-states获取物质出门列表
 | ||
|         /// <summary>
 | ||
|         /// 根据projectId、GoodsManageType获取物质出门列表
 | ||
|         /// </summary>
 | ||
|         /// <param name="projectId"></param>
 | ||
|         /// <param name="states">状态(0-待提交;1-审核中;2-审核完成;-1:作废)</param>
 | ||
|         /// <param name="pageIndex">页码</param>
 | ||
|         /// <returns></returns>
 | ||
|         public Model.ResponeData getGoodsManageByProjectIdStates(string projectId, string states, int pageIndex)
 | ||
|         {
 | ||
|             var responeData = new Model.ResponeData();
 | ||
|             try
 | ||
|             {                
 | ||
|                 var getDataList = APIGoodsManageService.getGoodsManageByProjectIdStates(projectId, states, pageIndex);
 | ||
|                 int pageCount = APIGoodsManageService.getGoodsManageListCount;                
 | ||
|                 responeData.data = new { pageCount, getDataList };
 | ||
|             }
 | ||
|             catch (Exception ex)
 | ||
|             {
 | ||
|                 responeData.code = 0;
 | ||
|                 responeData.message = ex.Message;
 | ||
|             }
 | ||
| 
 | ||
|             return responeData;
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 保存GoodsManage
 | ||
|         /// <summary>
 | ||
|         /// 保存GoodsManage
 | ||
|         /// </summary>
 | ||
|         /// <param name="GoodsManage">物质出门信息</param>
 | ||
|         /// <returns></returns>
 | ||
|         [HttpPost]
 | ||
|         public Model.ResponeData SaveGoodsManage([FromBody] Model.GoodsManageItem GoodsManage)
 | ||
|         {
 | ||
|             var responeData = new Model.ResponeData();
 | ||
|             try
 | ||
|             {
 | ||
|                 APIGoodsManageService.SaveGoodsManage(GoodsManage);
 | ||
|             }
 | ||
|             catch (Exception ex)
 | ||
|             {
 | ||
|                 responeData.code = 0;
 | ||
|                 responeData.message = ex.Message;
 | ||
|             }
 | ||
| 
 | ||
|             return responeData;
 | ||
|         }
 | ||
|         #endregion
 | ||
|     }
 | ||
| }
 |