建筑行业报表
This commit is contained in:
@@ -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