校正人工时及统计修改
This commit is contained in:
@@ -28,6 +28,7 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 页面加载
|
||||
@@ -41,14 +42,14 @@ namespace FineUIPro.Web.common
|
||||
ProjectId = CurrUser.LoginProjectId;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
//安全人工时
|
||||
int wHours = db.SitePerson_PersonInOutNumber.Where(x=> x.ProjectId == ProjectId).Max(x => x.WorkHours ) ?? 0;
|
||||
int wHours = db.SitePerson_PersonInOutNumber.Where(x => x.ProjectId == ProjectId).Max(x => x.WorkHours) ?? 0;
|
||||
this.divSafeWorkTime.InnerHtml = wHours.ToString();
|
||||
|
||||
//本月安全人工时
|
||||
int wHoursMonth = 0;
|
||||
DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString()+"-"+ DateTime.Now.Month.ToString());
|
||||
DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString());
|
||||
var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.ProjectId, sDate);
|
||||
if (dayReports.Count>0)
|
||||
if (dayReports.Count > 0)
|
||||
{
|
||||
wHoursMonth = Convert.ToInt32(dayReports[0].DayWorkTime);
|
||||
}
|
||||
@@ -60,11 +61,11 @@ namespace FineUIPro.Web.common
|
||||
|
||||
//安全管理人员
|
||||
var allSum = from x in Funs.DB.SitePerson_Person
|
||||
where x.IsUsed == true && x.ProjectId==ProjectId
|
||||
where x.IsUsed == true && x.ProjectId == ProjectId
|
||||
select x;
|
||||
var glAllPerson = from x in allSum
|
||||
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
where (y.PostType == "1" || y.PostType == "4") && x.ProjectId==ProjectId //一般管理岗位和特种管理人员
|
||||
where (y.PostType == "1" || y.PostType == "4") && x.ProjectId == ProjectId //一般管理岗位和特种管理人员
|
||||
select x;
|
||||
this.divSafeManagePersonNum.InnerHtml = glAllPerson.Count().ToString();
|
||||
|
||||
@@ -97,7 +98,7 @@ namespace FineUIPro.Web.common
|
||||
|
||||
//施工审批量
|
||||
int sgspl = Funs.DB.Solution_CQMSConstructSolution.Where(x => x.ProjectId == ProjectId && x.State == "1").Count();
|
||||
div_sgfaSpl.InnerHtml = sgspl.ToString() ;
|
||||
div_sgfaSpl.InnerHtml = sgspl.ToString();
|
||||
|
||||
//质量共检
|
||||
getZlgj();
|
||||
@@ -115,6 +116,7 @@ namespace FineUIPro.Web.common
|
||||
getProjectSitePerson();
|
||||
|
||||
//工作台面
|
||||
getGjsx();
|
||||
getGztm();
|
||||
|
||||
//材料到货
|
||||
@@ -127,7 +129,7 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
int AllCount = 0;
|
||||
int MCount = 0;
|
||||
var getallin = APIPageDataService.getPersonNum(ProjectId,DateTime.Now);
|
||||
var getallin = APIPageDataService.getPersonNum(ProjectId, DateTime.Now);
|
||||
AllCount = getallin.Count();
|
||||
if (AllCount > 0)
|
||||
{
|
||||
@@ -152,13 +154,13 @@ namespace FineUIPro.Web.common
|
||||
private void getProjectSitePerson()
|
||||
{
|
||||
var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null) && x.Progress != null
|
||||
&& x.ProjectId==ProjectId).ToList();
|
||||
&& x.ProjectId == ProjectId).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
ProjectPersonMc += "'" + item.ShortName + "',";
|
||||
ProjectPersonCount += "'" + APIPageDataService.getPersonNum(item.ProjectId, DateTime.Now).Count() + "',";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ProjectPersonMc)&& !string.IsNullOrEmpty(ProjectPersonCount))
|
||||
if (!string.IsNullOrEmpty(ProjectPersonMc) && !string.IsNullOrEmpty(ProjectPersonCount))
|
||||
{
|
||||
ProjectPersonMc = ProjectPersonMc.TrimEnd(',');
|
||||
ProjectPersonCount = ProjectPersonCount.TrimEnd(',');
|
||||
@@ -179,7 +181,7 @@ namespace FineUIPro.Web.common
|
||||
/// 获取隐患整改闭环项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int GetGeneralClosedNum()
|
||||
public int GetGeneralClosedNum()
|
||||
{
|
||||
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.States == "3" && x.ProjectId == ProjectId
|
||||
@@ -190,7 +192,7 @@ namespace FineUIPro.Web.common
|
||||
/// 获取隐患未整改完成项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int GetGeneralNotClosedNum()
|
||||
public int GetGeneralNotClosedNum()
|
||||
{
|
||||
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.States != "3" && x.ProjectId == ProjectId
|
||||
@@ -230,7 +232,7 @@ namespace FineUIPro.Web.common
|
||||
if (project != null)
|
||||
{
|
||||
spanProjectName = "<span title='" + project.ShortName + "'>" + project.ShortName + "</span>";
|
||||
spanRemark= "<span title='" + project.Remark + "'>" + project.Remark + "</span>";
|
||||
spanRemark = "<span title='" + project.Remark + "'>" + project.Remark + "</span>";
|
||||
divProjectNameTitle = project.ProjectName;
|
||||
if (!string.IsNullOrEmpty(project.ProjectAddress))
|
||||
{
|
||||
@@ -345,7 +347,7 @@ namespace FineUIPro.Web.common
|
||||
int allCount = 0;
|
||||
var getPersonQualitys = from x in Funs.DB.QualityAudit_PersonQuality
|
||||
join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId
|
||||
where x.LimitDate.HasValue && x.LimitDate < DateTime.Now && y.ProjectId==ProjectId
|
||||
where x.LimitDate.HasValue && x.LimitDate < DateTime.Now && y.ProjectId == ProjectId
|
||||
select x;
|
||||
//// 预警人数
|
||||
allCount = getPersonQualitys.Count();
|
||||
@@ -356,12 +358,12 @@ namespace FineUIPro.Web.common
|
||||
/// 机械预警
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected int GetJxyjNum()
|
||||
protected int GetJxyjNum()
|
||||
{
|
||||
int result = 0;
|
||||
//机具报验的到期提醒和过期提醒记录数加一起
|
||||
//机具报验的到期提醒数
|
||||
var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate && x.ProjectId==ProjectId
|
||||
var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate && x.ProjectId == ProjectId
|
||||
&& ((DateTime)x.NextTestDate).AddDays(-15) < DateTime.Now).Count();
|
||||
//过期提醒记录数
|
||||
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now && x.ProjectId == ProjectId).Count();
|
||||
@@ -455,8 +457,9 @@ namespace FineUIPro.Web.common
|
||||
/// 动火作业许可证
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected int getWrokCount0() {
|
||||
var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId&&x.LicenseTypeName== "动火作业许可证").ToList().Count;
|
||||
protected int getWrokCount0()
|
||||
{
|
||||
var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "动火作业许可证").ToList().Count;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -492,7 +495,7 @@ namespace FineUIPro.Web.common
|
||||
protected void getZlwt()
|
||||
{
|
||||
zlallNumber = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && x.ProjectId==ProjectId
|
||||
where x.CheckDate <= DateTime.Now && x.ProjectId == ProjectId
|
||||
select x).Count().ToString();
|
||||
var num2 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && x.State == "7" && x.ProjectId == ProjectId
|
||||
@@ -536,12 +539,13 @@ namespace FineUIPro.Web.common
|
||||
zlgjzgl = zgl.ToString();
|
||||
zggjzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
zlgjzgl = zgl.ToString();
|
||||
zggjzglDataValue = "0";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -565,7 +569,7 @@ namespace FineUIPro.Web.common
|
||||
join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId
|
||||
join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID
|
||||
where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null
|
||||
&& a.ProjectId ==ProjectId
|
||||
&& a.ProjectId == ProjectId
|
||||
select x.NDEItemID).Count();
|
||||
//一次检测返修焊口数
|
||||
int oneCheckRepairJotNum = (from x in db.HJGL_Batch_NDEItem
|
||||
@@ -573,7 +577,7 @@ namespace FineUIPro.Web.common
|
||||
join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId
|
||||
join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID
|
||||
where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null && x.CheckResult == "2"
|
||||
&& a.ProjectId ==ProjectId
|
||||
&& a.ProjectId == ProjectId
|
||||
select x.NDEItemID).Count();
|
||||
if (oneCheckJotNum > 0)
|
||||
{
|
||||
@@ -799,29 +803,35 @@ namespace FineUIPro.Web.common
|
||||
#endregion
|
||||
|
||||
#region 作业许可列表
|
||||
protected string getLicenseManager() {
|
||||
protected string getLicenseManager()
|
||||
{
|
||||
string returnHtml = "";
|
||||
var list = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
var gfx = "风险作业";
|
||||
if (item.IsHighRisk!=true)
|
||||
if (item.IsHighRisk != true)
|
||||
{
|
||||
gfx = "非高风险";
|
||||
}
|
||||
var shortUnitname = Funs.DB.Base_Unit.Where(x => x.UnitId == item.UnitId).FirstOrDefault().ShortUnitName;
|
||||
returnHtml+= "<div class=\"li\">"+item.LicenseManagerCode+"-"+shortUnitname + "-"+item.WorkAreaName+"-"+ gfx+"-"+item.LicenseTypeName
|
||||
+"</div>";
|
||||
returnHtml += "<div class=\"li\">" + item.LicenseManagerCode + "-" + shortUnitname + "-" + item.WorkAreaName + "-" + gfx + "-" + item.LicenseTypeName
|
||||
+ "</div>";
|
||||
}
|
||||
return returnHtml;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 工作台面
|
||||
protected void getGztm() {
|
||||
div_dbsxlist.InnerHtml = "";
|
||||
//关键事项
|
||||
string strSql = @"SELECT GJSXID AS DataId
|
||||
|
||||
protected void getGztm()
|
||||
{
|
||||
//div_dbsxlist.InnerHtml = "";
|
||||
string returnDbHtml = "<div></div>";
|
||||
if (!string.IsNullOrEmpty(ProjectId))
|
||||
{
|
||||
//关键事项
|
||||
string strSql = @"SELECT GJSXID AS DataId
|
||||
,'0BEA2126-7A48-40EB-8E21-99148E91A22B' AS MenuId
|
||||
,'关键事项待处理' AS MenuName
|
||||
,GJSX.Detail AS Content
|
||||
@@ -837,26 +847,80 @@ namespace FineUIPro.Web.common
|
||||
and (select count(*) from GJSX_Process process where process.UserId=@userId and process.GJSXID=GJSX.GJSXID)>0)
|
||||
or (GJSX.User_Acceptance like '%'+@userId+'%' and (select count(*) from GJSX_detail detail where detail.GJSXID=GJSX.GJSXID)=(select count(*) from GJSX_Process process where process.GJSXID=GJSX.GJSXID))
|
||||
)";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
listStr.Add(new SqlParameter("@userId", CurrUser.UserId));
|
||||
listStr.Add(new SqlParameter("@projectId", ProjectId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
var Gjsxcount = tb.Rows.Count;
|
||||
div_gjsx.InnerHtml = Gjsxcount.ToString() ;
|
||||
listStr.Add(new SqlParameter("@userId", CurrUser.UserId));
|
||||
listStr.Add(new SqlParameter("@projectId", ProjectId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
var Gjsxcount = tb.Rows.Count;
|
||||
div_gjsx.InnerHtml = Gjsxcount.ToString();
|
||||
|
||||
var getDataList = Funs.DB.Sp_Project_GetToDoItems(this.CurrUser.LoginProjectId, this.CurrUser.UserId).ToList();
|
||||
//待办事项、个人流程
|
||||
div_dbsx.InnerHtml= getDataList.Count().ToString();
|
||||
div_grlc.InnerHtml = getDataList.Count().ToString();
|
||||
string returnHtml = "";
|
||||
foreach (var item in getDataList)
|
||||
{
|
||||
returnHtml += "<div class=\"li\" style='cursor:pointer' onclick=\"returnWindows('" + item.PCUrl + "')\"><span>"+ item.MenuName + "</span><span>" + item.Content+"</span><span>"+
|
||||
item.DataTime.ToString().Replace('/','-').Split(' ')[0] + "</span></div>";
|
||||
var getDataList = Funs.DB.Sp_Project_GetToDoItems(this.CurrUser.LoginProjectId, this.CurrUser.UserId).ToList();
|
||||
//待办事项、个人流程
|
||||
div_dbsx.InnerHtml = getDataList.Count().ToString();
|
||||
div_grlc.InnerHtml = getDataList.Count().ToString();
|
||||
foreach (var item in getDataList)
|
||||
{
|
||||
returnDbHtml += "<div class=\"li\" style=\"cursor:pointer\" onclick=\"returnWindows(\"" + item.PCUrl + "\")\"><span>" + item.MenuName + "</span><span>" + item.Content + "</span><span>" +
|
||||
item.DataTime.ToString().Replace('/', '-').Split(' ')[0] + "</span></div>";
|
||||
}
|
||||
}
|
||||
div_dbsxlist.InnerHtml = returnHtml;
|
||||
else {
|
||||
returnDbHtml = "<div></div>";
|
||||
}
|
||||
this.div_dbsxlist.InnerHtml = returnDbHtml;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载关键事项
|
||||
/// </summary>
|
||||
protected void getGjsx()
|
||||
{
|
||||
string returnDbHtml = "<div></div>";
|
||||
////关键事项
|
||||
if (!string.IsNullOrEmpty(ProjectId))
|
||||
{
|
||||
string strSql = @"SELECT GJSXID AS DataId
|
||||
,'0BEA2126-7A48-40EB-8E21-99148E91A22B' AS MenuId
|
||||
,'关键事项待处理' AS MenuName
|
||||
,GJSX.Detail AS Content
|
||||
,users.UserId
|
||||
,users.UserName
|
||||
,GJSX.CreateDate AS DataTime
|
||||
,CONVERT(varchar(100),GJSX.CreateDate, 23) AS DataTimeStr
|
||||
,'../PZHGL/GJSX/GJSXListEdit.aspx?ToDo=ToDo&EditType=Edit&ID='+GJSXID AS PCUrl
|
||||
FROM GJSX
|
||||
LEFT JOIN Sys_User AS users ON users.UserId =@userId
|
||||
WHERE GJSX.ProjectId=@projectId AND
|
||||
GJSX.State != 0 AND (((select count(*) from GJSX_detail detail where detail.Progress_user=@userId and detail.GJSXID=GJSX.GJSXID)=0
|
||||
and (select count(*) from GJSX_Process process where process.UserId=@userId and process.GJSXID=GJSX.GJSXID)>0)
|
||||
or (GJSX.User_Acceptance like '%'+@userId+'%' and (select count(*) from GJSX_detail detail where detail.GJSXID=GJSX.GJSXID)=(select count(*) from GJSX_Process process where process.GJSXID=GJSX.GJSXID))
|
||||
)";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
listStr.Add(new SqlParameter("@userId", CurrUser.UserId));
|
||||
listStr.Add(new SqlParameter("@projectId", ProjectId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
returnDbHtml += "<div class=\"li\" style=\"cursor:pointer\" " +
|
||||
"onclick=\"returnWindows(\"" + tb.Rows[i]["PCUrl"] + "\")\"><span>" + tb.Rows[i]["MenuName"] + "</span><span>" + tb.Rows[i]["Content"] + "</span><span>" +
|
||||
tb.Rows[i]["DataTime"].ToString().Replace('/', '-').Split(' ')[0] + "</span></div>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
returnDbHtml = "<div></div>";
|
||||
}
|
||||
this.div_gjsxlist.InnerHtml = returnDbHtml;
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -868,9 +932,10 @@ namespace FineUIPro.Web.common
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
getGztm();
|
||||
getGjsx();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 打开待办
|
||||
/// </summary>
|
||||
@@ -895,23 +960,23 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
//管道材料
|
||||
var pid = BLL.ProjectService.GetCLProjectCodeByProjectId(ProjectId).ToString();
|
||||
var list = Funs.DB.CLGL_PipelineMaterialSumList.Where(x => x.Type == "M" && x.ProjectId== pid);
|
||||
var list = Funs.DB.CLGL_PipelineMaterialSumList.Where(x => x.Type == "M" && x.ProjectId == pid);
|
||||
foreach (var item in list)
|
||||
{
|
||||
gdclHtml += "<div class=\"tr\">";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">"+item.C1+"</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .8375rem; \">" + (string.IsNullOrEmpty(item.C2)?"0": item.C2) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + item.C1 + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .8375rem; \">" + (string.IsNullOrEmpty(item.C2) ? "0" : item.C2) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C4) ? "0" : item.C4) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C5) ? "0%" : item.C5) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C6)?"0": item.C6) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C7)?"0%": item.C7) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C8)?"0": item.C8) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C6) ? "0" : item.C6) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C7) ? "0%" : item.C7) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C8) ? "0" : item.C8) + "</span>";
|
||||
gdclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + (string.IsNullOrEmpty(item.C9) ? "0%" : item.C9) + "</span>";
|
||||
gdclHtml += "</div>";
|
||||
}
|
||||
|
||||
//设备材料
|
||||
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "设备"&&x.ProjectId==pid);
|
||||
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "设备" && x.ProjectId == pid);
|
||||
foreach (var item in SbclList)
|
||||
{
|
||||
sbclHtml += "<div class=\"tr\">";
|
||||
@@ -935,8 +1000,8 @@ namespace FineUIPro.Web.common
|
||||
var dhbfb = "0%";
|
||||
if (SbcllCgl + Sbdhs != 0)
|
||||
{
|
||||
dhbfb = String.Format("{0:N2}", 100.0 * Sbdhs / (Sbdhs + SbcllCgl), 2) + "%";
|
||||
|
||||
dhbfb = String.Format("{0:N2}", 100.0 * Sbdhs / (Sbdhs + SbcllCgl), 2) + "%";
|
||||
|
||||
}
|
||||
sbclHtml += "<span class=\"r-line\" style=\"width: .9875rem; \">" + dhbfb + "</span>";
|
||||
sbclHtml += "</div>";
|
||||
|
||||
Reference in New Issue
Block a user