This commit is contained in:
2024-11-20 09:08:00 +08:00
parent f1abdbc6d0
commit 9300d77ab0
181 changed files with 28244 additions and 119 deletions
@@ -35,5 +35,84 @@ namespace WebAPI.Controllers
return responeData;
}
#endregion
#region ID
/// <summary>
/// 根据项目ID 获取整改单数据
/// </summary>
/// <param name="projectId">项目ID</param>
/// <returns></returns>
public Model.ResponeData getHSSERectifyNoticesChartAnalysis(string projectId)
{
var responeData = new Model.ResponeData();
try
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
int allCount = 0, uCount = 0, cCount = 0;
double rate = 1;
var getRectifyNotices = from x in db.Check_RectifyNotices
where x.States != Const.State_0 && x.States != null && x.ProjectId == projectId
select x;
if (!string.IsNullOrEmpty(projectId) && projectId != "")
{
getRectifyNotices = getRectifyNotices.Where(x => x.ProjectId == projectId);
}
//// 整改总数
allCount = getRectifyNotices.Count();
if (allCount > 0)
{
//// 已闭环
cCount = getRectifyNotices.Where(x => x.States == "5").Count();
uCount = allCount - cCount;
rate = Math.Round(uCount * 1.0 / allCount * 100, 1);
}
responeData.data = new { allCount, uCount, rate };
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region ID
/// <summary>
/// 根据项目ID 获取整改单数据
/// </summary>
/// <param name="projectId">项目ID</param>
/// <returns></returns>
public Model.ResponeData getHSSEPersonQualityChartAnalysis(string projectId)
{
var responeData = new Model.ResponeData();
try
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
int allCount = 0;
var getPersonQualitys = from x in db.QualityAudit_PersonQuality
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where (projectId == null || projectId == "" || y.ProjectId == projectId)
&& x.LimitDate.HasValue && x.LimitDate < DateTime.Now
select x;
//// 预警人数
allCount = getPersonQualitys.Count();
responeData.data = new { allCount };
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -218,18 +218,33 @@ namespace WebAPI.Controllers
/// <param name="strPass">0-未通过;1通过;空所有</param>
/// <param name="pageIndex">页码</param>
/// <returns>考试记录列表</returns>
public Model.ResponeData getTrainingTestRecordListQuery(string projectId, string unitId, string workPostId, string strPass, int pageIndex)
public Model.ResponeData getTrainingTestRecordListQuery(string projectId, string unitId, string workPostId, string departId, string strPass, int pageIndex)
{
var responeData = new Model.ResponeData();
try
{
var getDataLists = APITestRecordService.getTrainingTestRecordListByProjectId(projectId, unitId, workPostId, strPass, string.Empty);
int pageCount = getDataLists.Count;
if (pageCount > 0 && pageIndex > 0)
if (!string.IsNullOrEmpty(departId))
{
getDataLists = getDataLists.OrderByDescending(x => x.TestStartTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
var getDataLists = APITestRecordService.getTrainingTestRecordListByDepartId(unitId, departId, strPass, string.Empty);
int pageCount = getDataLists.Count;
if (pageCount > 0 && pageIndex > 0)
{
getDataLists = getDataLists.OrderByDescending(x => x.TestStartTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
responeData.data = new { pageCount, getDataLists };
}
else
{
var getDataLists = APITestRecordService.getTrainingTestRecordListByProjectId(projectId, unitId, workPostId, strPass, string.Empty);
int pageCount = getDataLists.Count;
if (pageCount > 0 && pageIndex > 0)
{
getDataLists = getDataLists.OrderByDescending(x => x.TestStartTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
responeData.data = new { pageCount, getDataLists };
}
responeData.data = new { pageCount, getDataLists };
}
catch (Exception ex)
{
@@ -240,38 +255,6 @@ namespace WebAPI.Controllers
}
#endregion
#region ProjectId获取所有考试记录列表
/// <summary>
/// 根据ProjectId获取所有考试记录列表
/// </summary>
/// <param name="projectId">项目ID</param>
/// <param name="unitId">单位ID</param>
/// <param name="workPostId">岗位ID</param>
/// <param name="strPass">0-未通过;1通过;空所有</param>
/// <param name="strParam">参数</param>
/// <param name="pageIndex">页码</param>
/// <returns>考试记录列表</returns>
public Model.ResponeData getTrainingTestRecordListQuery(string projectId, string unitId, string workPostId, string strPass,string strParam, int pageIndex)
{
var responeData = new Model.ResponeData();
try
{
var getDataLists = APITestRecordService.getTrainingTestRecordListByProjectId(projectId, unitId, workPostId, strPass, strParam);
int pageCount = getDataLists.Count;
if (pageCount > 0 && pageIndex > 0)
{
getDataLists = getDataLists.OrderByDescending(x => x.TestStartTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
responeData.data = new { pageCount, getDataLists };
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region TestRecordItemIdselectedItem
/// <summary>