8efe030f47
为收敛当前分支代码范围并统一人员服务目录,移除历史模块与静态资源,减少无效代码和目录分散带来的维护成本。
129 lines
3.9 KiB
C#
129 lines
3.9 KiB
C#
using BLL;
|
||
using System;
|
||
using System.Linq;
|
||
using System.Web.Http;
|
||
|
||
namespace WebAPI.Controllers
|
||
{
|
||
/// <summary>
|
||
///
|
||
/// </summary>
|
||
public class UnitController : ApiController
|
||
{
|
||
#region 根据UnitId获取单位信息
|
||
/// <summary>
|
||
/// 根据UnitId获取单位信息
|
||
/// </summary>
|
||
/// <param name="unitId"></param>
|
||
/// <returns></returns>
|
||
public Model.ResponeData getUnitByUnitId(string unitId)
|
||
{
|
||
var responeData = new Model.ResponeData();
|
||
try
|
||
{
|
||
responeData.data = APIUnitService.getUnitByUnitId(unitId);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
responeData.code = 0;
|
||
responeData.message = ex.Message;
|
||
}
|
||
|
||
return responeData;
|
||
}
|
||
#endregion
|
||
|
||
#region 获取所有单位
|
||
/// <summary>
|
||
/// 获取所有单位
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
public Model.ResponeData getUnitLists()
|
||
{
|
||
var responeData = new Model.ResponeData();
|
||
try
|
||
{
|
||
responeData.data = APIUnitService.getUnitLists();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
responeData.code = 0;
|
||
responeData.message = ex.Message;
|
||
}
|
||
|
||
return responeData;
|
||
}
|
||
#endregion
|
||
|
||
#region 获取项目所有单位
|
||
/// <summary>
|
||
/// 获取项目所有单位
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
public Model.ResponeData getProjectUnitLists(string projectId)
|
||
{
|
||
var responeData = new Model.ResponeData();
|
||
try
|
||
{
|
||
responeData.data = APIUnitService.getProjectUnitLists(projectId);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
responeData.code = 0;
|
||
responeData.message = ex.Message;
|
||
}
|
||
|
||
return responeData;
|
||
}
|
||
#endregion
|
||
|
||
#region 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5)
|
||
/// <summary>
|
||
/// 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5)
|
||
/// </summary>
|
||
/// <param name="projectId">项目ID</param>
|
||
/// <param name="unitType">类型(null 所有单位)</param>
|
||
/// <returns></returns>
|
||
public Model.ResponeData getUnitByProjectIdUnitType(string projectId, string unitType)
|
||
{
|
||
var responeData = new Model.ResponeData();
|
||
try
|
||
{
|
||
responeData.data = APIUnitService.getUnitByProjectIdUnitType(projectId, unitType);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
responeData.code = 0;
|
||
responeData.message = ex.Message;
|
||
}
|
||
|
||
return responeData;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5)
|
||
/// </summary>
|
||
/// <param name="projectId">项目ID</param>
|
||
/// <param name="strParam">查询条件</param>
|
||
/// <param name="unitType">类型(null 所有单位)</param>
|
||
/// <returns></returns>
|
||
public Model.ResponeData getUnitByProjectIdUnitTypeQuery(string projectId, string strParam, string unitType)
|
||
{
|
||
var responeData = new Model.ResponeData();
|
||
try
|
||
{
|
||
responeData.data = APIUnitService.getUnitByProjectIdUnitTypeQuery(projectId, strParam, unitType);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
responeData.code = 0;
|
||
responeData.message = ex.Message;
|
||
}
|
||
|
||
return responeData;
|
||
}
|
||
#endregion
|
||
|
||
}
|
||
}
|