Basf_TCC11/HJGL/WebApi/Controllers/CheckController.cs

105 lines
2.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using BLL;
namespace WebApi.Controllers
{
public class CheckController : ApiController
{
#region
/// <summary>
/// 保存检查(巡检)信息
/// </summary>
/// <param name="newItem">检查信息</param>
/// <returns></returns>
[HttpPost]
public Model.ResponeData SaveCheckInfo([FromBody] Model.CheckItem newItem)
{
var responeData = new Model.ResponeData();
try
{
APICheckService.SaveCheckInfo(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 保存检查(巡检)信息
/// </summary>
/// <param name="newItem">检查信息</param>
/// <returns></returns>
[HttpPost]
public Model.ResponeData UpdateReCheckInfo([FromBody] Model.CheckItem newItem)
{
var responeData = new Model.ResponeData();
try
{
APICheckService.UpdateReCheckInfo(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 获取项目区域的检查列表
/// </summary>
/// <param name="projectArea">项目区域</param>
/// <returns></returns>
public Model.ResponeData GetCheckList(string projectArea)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APICheckService.GetCheckList(projectArea);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 根据主建获取检查信息
/// </summary>
/// <param name="checkId">主建</param>
/// <returns></returns>
public Model.ResponeData GetCheckInfo(string checkId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APICheckService.GetCheckInfo(checkId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}