Files
SGGL_SHJ/SGGL/WebAPI/Controllers/UnitController.cs
T
lpf 8efe030f47 refactor: 清理旧模块资源并整理人员服务目录
为收敛当前分支代码范围并统一人员服务目录,移除历史模块与静态资源,减少无效代码和目录分散带来的维护成本。
2026-09-19 13:45:38 +08:00

129 lines
3.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 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
}
}