171 lines
4.9 KiB
C#
171 lines
4.9 KiB
C#
|
using BLL;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Net;
|
|||
|
using System.Net.Http;
|
|||
|
using System.Web.Http;
|
|||
|
|
|||
|
namespace WebAPI
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 智能设备数据接收接口
|
|||
|
/// </summary>
|
|||
|
public class LOTController : ApiController
|
|||
|
{
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 保存环境监测数据
|
|||
|
/// </summary>
|
|||
|
/// <param name="input"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public Model.ResponeData SaveEnvironmentData(Model.EnvironmentalCheckInput input)
|
|||
|
{
|
|||
|
var responeData = new Model.ResponeData();
|
|||
|
try
|
|||
|
{
|
|||
|
if (BLL.APIProjectService.getProjectByProjectId(input.ProjectId)!=null)
|
|||
|
{
|
|||
|
responeData.data = LotAPIService.saveEnvironmentCheck(input);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = "此项目不存在!";
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = ex.Message;
|
|||
|
}
|
|||
|
|
|||
|
return responeData;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 保存深基坑监测数据
|
|||
|
/// </summary>
|
|||
|
/// <param name="input"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public Model.ResponeData SaveDeepPitCheckData(Model.DeepPitCheckInput input)
|
|||
|
{
|
|||
|
var responeData = new Model.ResponeData();
|
|||
|
try
|
|||
|
{
|
|||
|
if (BLL.APIProjectService.getProjectByProjectId(input.ProjectId) != null)
|
|||
|
{
|
|||
|
responeData.data = LotAPIService.saveDeepPitCheck(input);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = "此项目不存在!";
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = ex.Message;
|
|||
|
}
|
|||
|
|
|||
|
return responeData;
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 保存水电监测数据
|
|||
|
/// </summary>
|
|||
|
/// <param name="input"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public Model.ResponeData SaveEnergyData(Model.EnergyInput input)
|
|||
|
{
|
|||
|
var responeData = new Model.ResponeData();
|
|||
|
try
|
|||
|
{
|
|||
|
if (BLL.APIProjectService.getProjectByProjectId(input.ProjectId) != null)
|
|||
|
{
|
|||
|
responeData.data = LotAPIService.saveWaterElectricityCheck(input);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = "此项目不存在!";
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = ex.Message;
|
|||
|
}
|
|||
|
|
|||
|
return responeData;
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 保存塔式起重机预警
|
|||
|
/// </summary>
|
|||
|
/// <param name="input"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public Model.ResponeData SaveTowerCraneWarningData(Model.TowerCraneWarningInput input)
|
|||
|
{
|
|||
|
var responeData = new Model.ResponeData();
|
|||
|
try
|
|||
|
{
|
|||
|
if (BLL.APIProjectService.getProjectByProjectId(input.ProjectId) != null)
|
|||
|
{
|
|||
|
responeData.data = LotAPIService.saveTowerCraneWarning(input);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = "此项目不存在!";
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = ex.Message;
|
|||
|
}
|
|||
|
|
|||
|
return responeData;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 保存车辆冲洗监测
|
|||
|
/// </summary>
|
|||
|
/// <param name="input"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public Model.ResponeData SaveCarWashCheckIData(Model.CarWashCheckInput input)
|
|||
|
{
|
|||
|
var responeData = new Model.ResponeData();
|
|||
|
try
|
|||
|
{
|
|||
|
if (BLL.APIProjectService.getProjectByProjectId(input.ProjectId) != null)
|
|||
|
{
|
|||
|
responeData.data = LotAPIService.saveCarWashCheck(input);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = "此项目不存在!";
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
responeData.code = 0;
|
|||
|
responeData.message = ex.Message;
|
|||
|
}
|
|||
|
|
|||
|
return responeData;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|