建筑行业报表
This commit is contained in:
@@ -48,7 +48,7 @@ namespace WebAPI
|
||||
/// <param name="states"></param>
|
||||
/// <param name="pageIndex">页码</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getHazardRegisterByProjectIdStates(string projectId, string states, int pageIndex)
|
||||
public Model.ResponeData getHazardRegisterByProjectIdStates(string projectId, string states, int pageIndex,int pageSize, string ProblemTypes)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
@@ -58,12 +58,12 @@ namespace WebAPI
|
||||
projectId = null;
|
||||
}
|
||||
List<Model.HazardRegisterItem> getDataList = new List<Model.HazardRegisterItem>();
|
||||
int pageCount = Funs.DB.HSSE_Hazard_HazardRegister.Count(x => (x.ProjectId == projectId || projectId == null) && (x.States == states || states == null));
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
getDataList = APIUnitHazardRegisterService.getHazardRegisterByProjectIdStates(projectId, states, pageIndex);
|
||||
}
|
||||
responeData.data = new { pageCount, getDataList };
|
||||
// int pageCount = Funs.DB.HSSE_Hazard_HazardRegister.Count(x => (x.ProjectId == projectId || projectId == null) && (x.States == states || states == null));
|
||||
// if (pageCount > 0 && pageIndex > 0)
|
||||
// {
|
||||
getDataList = APIUnitHazardRegisterService.getHazardRegisterByProjectIdStates(projectId, states, pageIndex, pageSize,ProblemTypes);
|
||||
// }
|
||||
responeData.data = new { getDataList.Count, getDataList };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -88,5 +88,97 @@ namespace WebAPI.Controllers.HSSE
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取质量集合
|
||||
/// <summary>
|
||||
/// 获取集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getProjectQualityList(string RectifyName, int PageNumber, int PageSize)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
// var query = (from a in Funs.DB.WBS_ProjectQuality
|
||||
// join b in Funs.DB.Base_QualityQuestionType on a.ProjectName equals b.QualityQuestionTypeId into joined
|
||||
// from b in joined.DefaultIfEmpty()
|
||||
// select new
|
||||
// {
|
||||
// a.ProjectQualityId,
|
||||
// QualityQuestionType = b != null ? b.QualityQuestionType : null
|
||||
// }).ToList();
|
||||
//
|
||||
//
|
||||
var query = (from x in Funs.DB.Base_QualityQuestionType
|
||||
select new
|
||||
{
|
||||
x.QualityQuestionTypeId,
|
||||
x.QualityQuestionType,
|
||||
}).ToList();
|
||||
|
||||
if (!string.IsNullOrEmpty(RectifyName))
|
||||
{
|
||||
query = query.Where(x => x.QualityQuestionType.Contains(RectifyName)).ToList();
|
||||
}
|
||||
|
||||
var paginatedQuery = query
|
||||
.Skip((PageNumber - 1) * PageSize)
|
||||
.Take(PageSize)
|
||||
.ToList();
|
||||
|
||||
responeData.data = paginatedQuery;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据id获取质量明细列表
|
||||
/// <summary>
|
||||
/// 获取集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getQualityItemListBy(string RectifyId,string HazardSourcePoint, int PageNumber, int PageSize)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var query = (from x in Funs.DB.WBS_ProjectQuality
|
||||
where x.ProjectName == RectifyId
|
||||
select new
|
||||
{
|
||||
x.ProjectQualityId,
|
||||
x.ProjectQualityDes,
|
||||
x.ProjectQualityResult
|
||||
}).ToList();
|
||||
if (!string.IsNullOrEmpty(HazardSourcePoint))
|
||||
{
|
||||
query = query.Where(x => x.ProjectQualityDes.Contains(HazardSourcePoint)).ToList();
|
||||
}
|
||||
|
||||
var paginatedQuery = query
|
||||
.Skip((PageNumber - 1) * PageSize)
|
||||
.Take(PageSize)
|
||||
.ToList();
|
||||
|
||||
responeData.data = paginatedQuery;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user