943 lines
44 KiB
C#
943 lines
44 KiB
C#
|
using BLL;
|
|||
|
using Newtonsoft.Json;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Data;
|
|||
|
using System.Data.SqlClient;
|
|||
|
using System.IO;
|
|||
|
using System.Linq;
|
|||
|
using System.Web;
|
|||
|
using System.Web.UI;
|
|||
|
using System.Web.UI.WebControls;
|
|||
|
|
|||
|
|
|||
|
namespace FineUIPro.Web.common
|
|||
|
{
|
|||
|
public partial class mainProject2 : PageBase
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 项目id
|
|||
|
/// </summary>
|
|||
|
public string ProjectId
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return (string)ViewState["ProjectId"];
|
|||
|
}
|
|||
|
set
|
|||
|
{
|
|||
|
ViewState["ProjectId"] = value;
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 页面加载
|
|||
|
/// </summary>
|
|||
|
/// <param name="sender"></param>
|
|||
|
/// <param name="e"></param>
|
|||
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (!IsPostBack)
|
|||
|
{
|
|||
|
ProjectId = CurrUser.LoginProjectId;
|
|||
|
Model.SGGLDB db = Funs.DB;
|
|||
|
//安全人工时
|
|||
|
int wHours = db.SitePerson_PersonInOutNumber.Where(x=> x.ProjectId == ProjectId).Max(x => x.WorkHours ) ?? 0;
|
|||
|
this.divSafeWorkTime.InnerHtml = wHours.ToString();
|
|||
|
|
|||
|
//本月安全人工时
|
|||
|
int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day))
|
|||
|
&& x.ProjectId == ProjectId)
|
|||
|
.Max(x => x.WorkHours) ?? 0;
|
|||
|
this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
|
|||
|
|
|||
|
//安全培训累计人员
|
|||
|
var getTrainRecord = db.EduTrain_TrainRecord.Where(x => x.ProjectId == ProjectId).Max(x => x.TrainPersonNum) ?? 0;
|
|||
|
this.divSafePersonNum.InnerHtml = getTrainRecord.ToString();
|
|||
|
|
|||
|
//安全管理人员
|
|||
|
var allSum = from x in Funs.DB.SitePerson_Person
|
|||
|
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 //一般管理岗位和特种管理人员
|
|||
|
select x;
|
|||
|
this.divSafeManagePersonNum.InnerHtml = glAllPerson.Count().ToString();
|
|||
|
|
|||
|
//未遂事故
|
|||
|
var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
|
|||
|
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
|||
|
where y.AccidentTypeName.Contains("未遂") && x.ProjectId == ProjectId
|
|||
|
select x;
|
|||
|
var wsAccidentList2 = from x in db.Accident_AccidentReportOther
|
|||
|
join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue
|
|||
|
where y.ConstText.Contains("未遂") && x.ProjectId == ProjectId
|
|||
|
select x;
|
|||
|
this.divWS.InnerHtml = (wsAccidentList1.Count() + wsAccidentList2.Count()).ToString();
|
|||
|
|
|||
|
//整改数据
|
|||
|
getZgsj();
|
|||
|
|
|||
|
//风险预警
|
|||
|
getHazard();
|
|||
|
|
|||
|
//工程概况
|
|||
|
getProjectInfo();
|
|||
|
|
|||
|
//质量培训人员
|
|||
|
DateTime date = DateTime.Now.AddDays(-1);
|
|||
|
int CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson
|
|||
|
where x.IsTrain == true && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month && x.CompileDate.Value.Day == date.Day
|
|||
|
select x).Count();
|
|||
|
divCqmsPxNum.InnerHtml = CqmsPxNum.ToString();
|
|||
|
|
|||
|
//施工审批量
|
|||
|
int sgspl = Funs.DB.Solution_CQMSConstructSolution.Where(x => x.ProjectId == ProjectId && x.State == "1").Count();
|
|||
|
div_sgfaSpl.InnerHtml = sgspl.ToString() ;
|
|||
|
|
|||
|
//质量共检
|
|||
|
getZlgj();
|
|||
|
|
|||
|
//焊接
|
|||
|
getHj();
|
|||
|
|
|||
|
//加载质量问题
|
|||
|
getZlwt();
|
|||
|
|
|||
|
//人员信息
|
|||
|
getSitePerson();
|
|||
|
|
|||
|
//项目人员图表
|
|||
|
getProjectSitePerson();
|
|||
|
|
|||
|
//工作台面
|
|||
|
getGztm();
|
|||
|
|
|||
|
//材料到货
|
|||
|
getCldh();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#region 人员信息
|
|||
|
private void getSitePerson()
|
|||
|
{
|
|||
|
int AllCount = 0;
|
|||
|
int MCount = 0;
|
|||
|
var getallin = APIPageDataService.getPersonNum(ProjectId,DateTime.Now);
|
|||
|
AllCount = getallin.Count();
|
|||
|
if (AllCount > 0)
|
|||
|
{
|
|||
|
MCount = getallin.Where(x => x.PostType == Const.PostType_1).Count();
|
|||
|
}
|
|||
|
|
|||
|
if (AllCount > 0)
|
|||
|
{
|
|||
|
////当前现场总人数
|
|||
|
div_xcrs.InnerHtml = AllCount.ToString();
|
|||
|
//作业人数
|
|||
|
div_zyxcrs.InnerHtml = (AllCount - MCount).ToString();
|
|||
|
//管理人数
|
|||
|
div_glxcrs.InnerHtml = MCount.ToString();
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 项目人员图表
|
|||
|
protected string ProjectPersonCount;
|
|||
|
protected string ProjectPersonMc;
|
|||
|
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();
|
|||
|
foreach (var item in list)
|
|||
|
{
|
|||
|
ProjectPersonMc += "'" + item.ShortName + "',";
|
|||
|
ProjectPersonCount += "'" + APIPageDataService.getPersonNum(item.ProjectId, DateTime.Now).Count() + "',";
|
|||
|
}
|
|||
|
if (!string.IsNullOrEmpty(ProjectPersonMc)&& !string.IsNullOrEmpty(ProjectPersonCount))
|
|||
|
{
|
|||
|
ProjectPersonMc = ProjectPersonMc.TrimEnd(',');
|
|||
|
ProjectPersonCount = ProjectPersonCount.TrimEnd(',');
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 整改数据
|
|||
|
protected void getZgsj()
|
|||
|
{
|
|||
|
div_zgsj.InnerHtml = (GetGeneralClosedNum() + GetGeneralNotClosedNum()).ToString();
|
|||
|
div_zgywc.InnerHtml = GetGeneralClosedNum().ToString();
|
|||
|
div_zgwwc.InnerHtml = GetGeneralNotClosedNum().ToString();
|
|||
|
div_zgwcl.InnerHtml = String.Format("{0:N2}", 100.0 * GetGeneralClosedNum() / (GetGeneralNotClosedNum() + GetGeneralClosedNum())) + "%";
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取隐患整改闭环项
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public int GetGeneralClosedNum()
|
|||
|
{
|
|||
|
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
|||
|
where x.States == "3" && x.ProjectId == ProjectId
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 获取隐患未整改完成项
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public int GetGeneralNotClosedNum()
|
|||
|
{
|
|||
|
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
|||
|
where x.States != "3" && x.ProjectId == ProjectId
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 工程概括
|
|||
|
protected string divProjectNameTitle;
|
|||
|
protected string divProjectAddressTitle;
|
|||
|
protected string divProjectMoneyTitle;
|
|||
|
protected string divOwnUnitTitle;
|
|||
|
protected string divSGUnitTitle;
|
|||
|
protected string divJLUnitTitle;
|
|||
|
protected string divProjectImg;
|
|||
|
|
|||
|
protected string spanProjectName;
|
|||
|
protected string spanProjectAddress;
|
|||
|
protected string spanOwnUnit;
|
|||
|
protected string spanSGUnit;
|
|||
|
protected string spanJLUnit;
|
|||
|
protected string spanRemark;
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
private void getProjectInfo()
|
|||
|
{
|
|||
|
divProjectNameTitle = "";
|
|||
|
divProjectAddressTitle = "";
|
|||
|
divProjectMoneyTitle = "";
|
|||
|
divOwnUnitTitle = "";
|
|||
|
divSGUnitTitle = "";
|
|||
|
divJLUnitTitle = "";
|
|||
|
divProjectImg = "../res/indexv2/assets/image/index6/center-bg.jpeg";
|
|||
|
var project = ProjectService.GetProjectByProjectId(this.ProjectId);
|
|||
|
if (project != null)
|
|||
|
{
|
|||
|
spanProjectName = "<span title='" + project.ShortName + "'>" + project.ShortName + "</span>";
|
|||
|
spanRemark= "<span title='" + project.Remark + "'>" + project.Remark + "</span>";
|
|||
|
divProjectNameTitle = project.ProjectName;
|
|||
|
if (!string.IsNullOrEmpty(project.ProjectAddress))
|
|||
|
{
|
|||
|
//this.divProjectAddress.InnerHtml = project.ProjectAddress.Length > 8 ? project.ProjectAddress.Substring(0, 8) + "..." : project.ProjectAddress;
|
|||
|
spanProjectAddress = spanProjectName = "<span title='" + project.ProjectAddress + "'>" +
|
|||
|
(project.ProjectAddress.Length > 8 ? project.ProjectAddress.Substring(0, 8) + "..." : project.ProjectAddress) + "</span>";
|
|||
|
divProjectAddressTitle = project.ProjectAddress;
|
|||
|
}
|
|||
|
string unit_yz = ProjectService.getProjectUnitNameByUnitType(project.ProjectId, Const.ProjectUnitType_4);
|
|||
|
if (!string.IsNullOrEmpty(unit_yz))
|
|||
|
{
|
|||
|
//this.divOwnUnit.InnerHtml = unit_yz.Length > 8 ? unit_yz.Substring(0, 8) + "..." : unit_yz;
|
|||
|
spanOwnUnit = "<span title='" + unit_yz + "'>" +
|
|||
|
(unit_yz.Length > 8 ? unit_yz.Substring(0, 8) + "..." : unit_yz) + "</span>";
|
|||
|
divOwnUnitTitle = unit_yz;
|
|||
|
}
|
|||
|
string unit_JL = ProjectService.getProjectUnitNameByUnitType(project.ProjectId, Const.ProjectUnitType_3);
|
|||
|
if (!string.IsNullOrEmpty(unit_JL))
|
|||
|
{
|
|||
|
//this.divJLUnit.InnerHtml = unit_JL.Length > 8 ? unit_JL.Substring(0, 8) + "..." : unit_JL;
|
|||
|
spanJLUnit = "<span title='" + unit_JL + "'>" +
|
|||
|
(unit_JL.Length > 8 ? unit_JL.Substring(0, 8) + "..." : unit_JL) + "</span>";
|
|||
|
divJLUnitTitle = unit_JL;
|
|||
|
}
|
|||
|
|
|||
|
string unit_FB = ProjectService.getProjectUnitNameByUnitType(project.ProjectId, Const.ProjectUnitType_2);
|
|||
|
if (!string.IsNullOrEmpty(unit_FB))
|
|||
|
{
|
|||
|
//this.divSGUnit.InnerHtml = unit_FB.Length > 8 ? unit_FB.Substring(0, 8) + "..." : unit_FB + "...";
|
|||
|
spanSGUnit = "<span title='" + unit_FB + "'>" +
|
|||
|
(unit_FB.Length > 8 ? unit_FB.Substring(0, 8) + "..." : unit_FB + "...") + "</span>";
|
|||
|
}
|
|||
|
|
|||
|
var getSGName = from x in Funs.DB.Project_ProjectUnit
|
|||
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|||
|
where x.ProjectId == project.ProjectId && x.UnitType == Const.ProjectUnitType_2
|
|||
|
select y.UnitName;
|
|||
|
foreach (var item in getSGName)
|
|||
|
{
|
|||
|
divSGUnitTitle += item + ",";
|
|||
|
}
|
|||
|
//this.divProjectMoney.InnerHtml = divProjectMoneyTitle = project.ProjectMoney.ToString() + "万元";
|
|||
|
if (project.EndDate.HasValue)
|
|||
|
{
|
|||
|
this.divEndDate.InnerHtml = string.Format("{0:yyyy-MM-dd}", project.EndDate);
|
|||
|
int endDays = (project.EndDate.Value - DateTime.Now).Days;
|
|||
|
if (endDays >= 0)
|
|||
|
{
|
|||
|
this.divRemainingDays.InnerHtml = endDays.ToString() + "<span>天</span>";
|
|||
|
}
|
|||
|
if (project.StartDate.HasValue)
|
|||
|
{
|
|||
|
int pdays = (project.EndDate.Value - project.StartDate.Value).Days;
|
|||
|
if (pdays >= 0)
|
|||
|
{
|
|||
|
this.divProjectDays.InnerHtml = pdays.ToString() + "<span>天</span>";
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
var getImag = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == project.ProjectId);
|
|||
|
if (getImag != null && !string.IsNullOrEmpty(getImag.AttachUrl))
|
|||
|
{
|
|||
|
string url = getImag.AttachUrl.Replace('\\', '/');
|
|||
|
string firtstUrl = Funs.GetStrListByStr(url, ',').FirstOrDefault();
|
|||
|
if (!string.IsNullOrEmpty(firtstUrl))
|
|||
|
{
|
|||
|
string atturl = Funs.RootPath + firtstUrl.Replace(';', ' ').Trim();
|
|||
|
if (File.Exists(atturl))
|
|||
|
{
|
|||
|
divProjectImg = "../" + firtstUrl.Replace(';', ' ').Trim();
|
|||
|
//this.divProjectImgs.Src = divProjectImg;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 风险预警
|
|||
|
protected string riskData1;
|
|||
|
protected string riskData2;
|
|||
|
protected string riskData3;
|
|||
|
protected string riskData4;
|
|||
|
/// <summary>
|
|||
|
/// 获取风险管控
|
|||
|
/// </summary>
|
|||
|
private void getHazard()
|
|||
|
{
|
|||
|
var getHazards = from x in Funs.DB.Hazard_HazardSelectedItem
|
|||
|
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
|||
|
where x.ProjectId == ProjectId
|
|||
|
select new { x.HazardSelectedItemId, y.RiskLevel };
|
|||
|
var riskLevels = from x in Funs.DB.Base_RiskLevel select x;
|
|||
|
|
|||
|
List<int> RiskLevelNum = new List<int>();
|
|||
|
List<Model.SingleSerie> series = new List<Model.SingleSerie>();
|
|||
|
|
|||
|
riskData1 = getHazards.Count(x => x.RiskLevel == 1).ToString();
|
|||
|
riskData2 = getHazards.Count(x => x.RiskLevel == 2).ToString();
|
|||
|
riskData3 = getHazards.Count(x => x.RiskLevel == 3).ToString();
|
|||
|
riskData4 = getHazards.Count(x => x.RiskLevel == 4).ToString();
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 资质预警
|
|||
|
/// </summary>
|
|||
|
protected string getEarlyWarningCounts()
|
|||
|
{
|
|||
|
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
|
|||
|
select x;
|
|||
|
//// 预警人数
|
|||
|
allCount = getPersonQualitys.Count();
|
|||
|
return allCount.ToString();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 机械预警
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetJxyjNum()
|
|||
|
{
|
|||
|
int result = 0;
|
|||
|
//机具报验的到期提醒和过期提醒记录数加一起
|
|||
|
//机具报验的到期提醒数
|
|||
|
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();
|
|||
|
result = num1 + num2;
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取危大工程审批完成数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetCompletedNum()
|
|||
|
{
|
|||
|
var result = Project_HSSEData_HSSEService.GetCompletedNum(ProjectId);
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取危大工程培训人次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetTrainPersonNum()
|
|||
|
{
|
|||
|
var result = Project_HSSEData_HSSEService.GetTrainPersonNum(ProjectId);
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取危大工程施工个数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetConstructionNum()
|
|||
|
{
|
|||
|
var result = Project_HSSEData_HSSEService.GetConstructionNum(ProjectId);
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取危大工程完工个数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetFinishedNum()
|
|||
|
{
|
|||
|
var result = Project_HSSEData_HSSEService.GetFinishedNum(ProjectId);
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取超危大工程审批完成数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetSuperCompletedNum()
|
|||
|
{
|
|||
|
var result = Project_HSSEData_HSSEService.GetSuperCompletedNum(ProjectId);
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取超危大工程培训人次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetSuperTrainPersonNum()
|
|||
|
{
|
|||
|
var result = Project_HSSEData_HSSEService.GetSuperTrainPersonNum(ProjectId);
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取超危大工程施工个数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetSuperConstructionNum()
|
|||
|
{
|
|||
|
var result = Project_HSSEData_HSSEService.GetSuperConstructionNum(ProjectId);
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取超危大工程完工个数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int GetSuperFinishedNum()
|
|||
|
{
|
|||
|
var result = Project_HSSEData_HSSEService.GetSuperFinishedNum(ProjectId);
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 作业许可
|
|||
|
/// <summary>
|
|||
|
/// 动火作业许可证
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
protected int getWrokCount0() {
|
|||
|
var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId&&x.LicenseTypeName== "动火作业许可证").ToList().Count;
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
protected int getWrokCount1()
|
|||
|
{
|
|||
|
var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "高处作业许可证").ToList().Count;
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
protected int getWrokCount2()
|
|||
|
{
|
|||
|
var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "吊装作业许可证").ToList().Count;
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
protected int getWrokCount3()
|
|||
|
{
|
|||
|
var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId
|
|||
|
&& x.LicenseTypeName != "动火作业许可证" && x.LicenseTypeName != "高处作业许可证" && x.LicenseTypeName != "吊装作业许可证").ToList().Count;
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 质量问题
|
|||
|
//质量问题总计
|
|||
|
protected string zlallNumber;
|
|||
|
//质量问题合格数量
|
|||
|
protected string zlfinishNumber;
|
|||
|
//质量问题整改率
|
|||
|
protected string zlzgl;
|
|||
|
|
|||
|
protected string zgzglDataValue;
|
|||
|
protected void getZlwt()
|
|||
|
{
|
|||
|
zlallNumber = (from x in Funs.DB.Check_CheckControl
|
|||
|
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
|
|||
|
select x).Count();
|
|||
|
zlfinishNumber = num2.ToString();
|
|||
|
var num3 = (from x in Funs.DB.Check_CheckControl
|
|||
|
where x.CheckDate <= DateTime.Now && x.State != "7" && x.ProjectId == ProjectId
|
|||
|
select x).Count();
|
|||
|
|
|||
|
var zgl = String.Format("{0:N2}", 100.0 * num2 / (num2 + num3));
|
|||
|
zlzgl = zgl.ToString();
|
|||
|
zgzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 质量共检
|
|||
|
protected string zlgjallNumber;
|
|||
|
protected string zlgjfinishNumber;
|
|||
|
protected string zlgjzgl;
|
|||
|
|
|||
|
protected string zggjzglDataValue;
|
|||
|
protected void getZlgj()
|
|||
|
{
|
|||
|
//Check_JointCheck
|
|||
|
zlgjallNumber = (from x in Funs.DB.Check_JointCheck
|
|||
|
where x.CheckDate <= DateTime.Now && x.ProjectId == ProjectId
|
|||
|
select x).Count().ToString();
|
|||
|
|
|||
|
var num2 = (from x in Funs.DB.Check_JointCheck
|
|||
|
where x.CheckDate <= DateTime.Now && x.State == BLL.Const.JointCheck_Complete && x.ProjectId == ProjectId
|
|||
|
select x).Count();
|
|||
|
zlgjfinishNumber = num2.ToString();
|
|||
|
|
|||
|
var num3 = (from x in Funs.DB.Check_JointCheck
|
|||
|
where x.CheckDate <= DateTime.Now && x.State != BLL.Const.JointCheck_Complete && x.ProjectId == ProjectId
|
|||
|
select x).Count();
|
|||
|
var zgl = "0";
|
|||
|
if (num2 != 0)
|
|||
|
{
|
|||
|
zgl = String.Format("{0:N2}", 100.0 * num2 / (num2 + num3));
|
|||
|
zlgjzgl = zgl.ToString();
|
|||
|
zggjzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
|
|||
|
}
|
|||
|
else {
|
|||
|
zlgjzgl = zgl.ToString();
|
|||
|
zggjzglDataValue = "0";
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 焊接
|
|||
|
protected string hjallNumber = "0";
|
|||
|
protected string hjfinishNumber = "0";
|
|||
|
protected string hjzgl = "0";
|
|||
|
|
|||
|
protected string hjDataValue = "0";
|
|||
|
protected void getHj()
|
|||
|
{
|
|||
|
Model.SingleSerie series = new Model.SingleSerie();
|
|||
|
Model.BusinessColumn businessColumn = new Model.BusinessColumn();
|
|||
|
List<double> listdata = new List<double>();
|
|||
|
double result = 0;
|
|||
|
Model.SGGLDB db = Funs.DB;
|
|||
|
//一次检测合格焊口数
|
|||
|
int oneCheckJotNum = (from x in db.HJGL_Batch_NDEItem
|
|||
|
join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId
|
|||
|
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
|
|||
|
select x.NDEItemID).Count();
|
|||
|
//一次检测返修焊口数
|
|||
|
int oneCheckRepairJotNum = (from x in db.HJGL_Batch_NDEItem
|
|||
|
join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId
|
|||
|
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
|
|||
|
select x.NDEItemID).Count();
|
|||
|
if (oneCheckJotNum > 0)
|
|||
|
{
|
|||
|
var a = Convert.ToDouble(oneCheckJotNum - oneCheckRepairJotNum);
|
|||
|
var b = Convert.ToDouble(oneCheckJotNum);
|
|||
|
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 0));
|
|||
|
|
|||
|
hjallNumber = b.ToString();
|
|||
|
hjfinishNumber = a.ToString();
|
|||
|
hjzgl = result.ToString();
|
|||
|
hjDataValue = (100 - result).ToString();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 赢得值曲线
|
|||
|
protected string Two
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
List<Model.SingleSerie> series = new List<Model.SingleSerie>();
|
|||
|
Model.BusinessColumn businessColumn = new Model.BusinessColumn();
|
|||
|
List<string> listCategories = new List<string>();
|
|||
|
businessColumn.title = "赢得值曲线";
|
|||
|
Model.Project_Installation installation = BLL.Project_InstallationService.GetProjectInstallationByProjectId(this.CurrUser.LoginProjectId);
|
|||
|
if (installation != null)
|
|||
|
{
|
|||
|
Model.SingleSerie s = new Model.SingleSerie();
|
|||
|
Model.SingleSerie s2 = new Model.SingleSerie();
|
|||
|
Model.SingleSerie s3 = new Model.SingleSerie();
|
|||
|
Model.SingleSerie s4 = new Model.SingleSerie();
|
|||
|
Model.SingleSerie s5 = new Model.SingleSerie();
|
|||
|
Model.SingleSerie s6 = new Model.SingleSerie();
|
|||
|
List<double> listdata = new List<double>();
|
|||
|
List<double> listdata2 = new List<double>();
|
|||
|
List<double> listdata3 = new List<double>();
|
|||
|
List<double> listdata4 = new List<double>();
|
|||
|
List<double> listdata5 = new List<double>();
|
|||
|
List<double> listdata6 = new List<double>();
|
|||
|
string strSql = "select distinct (cast(YEAR(Months) as varchar(4))+'.'+cast(MONTH(Months) as varchar(2))) as 月份,t.Months," +
|
|||
|
"ThisRealCost as '本月已完工作实际费用-ACWP',ThisPlanCost as '本月已完工作预算费用-BCWP',ThisPlanValue as '本月计划工作预算费用-BCWS',TotalPlanValue as '累计计划工作预算费用-BCWS',TotalRealCost as '累计已完工作实际费用-ACWP',TotalPlanCost as '累计已完工作预算费用-BCWP' " +
|
|||
|
"from dbo.View_WBS_CostControlParentDetail as t where ParentId=@Id order by t.Months";
|
|||
|
//string date = DateTime.Now.Year + "-" + DateTime.Now.Month + "-01";
|
|||
|
SqlParameter[] parameter = new SqlParameter[]
|
|||
|
{
|
|||
|
new SqlParameter("@Id",installation.InstallationId),
|
|||
|
//new SqlParameter("@Months",date),
|
|||
|
};
|
|||
|
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|||
|
decimal lastbcws = 0, bcws = 0, lastacwp = 0, acwp = 0, lastbcwp = 0, bcwp = 0;
|
|||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|||
|
{
|
|||
|
dt.Rows[i]["本月已完工作实际费用-ACWP"] = Funs.GetNewDecimalOrZero(dt.Rows[i]["本月已完工作实际费用-ACWP"].ToString()) / 10000;
|
|||
|
dt.Rows[i]["本月已完工作预算费用-BCWP"] = Funs.GetNewDecimalOrZero(dt.Rows[i]["本月已完工作预算费用-BCWP"].ToString()) / 10000;
|
|||
|
dt.Rows[i]["本月计划工作预算费用-BCWS"] = Funs.GetNewDecimalOrZero(dt.Rows[i]["本月计划工作预算费用-BCWS"].ToString()) / 10000;
|
|||
|
bcws = Funs.GetNewDecimalOrZero(dt.Rows[i]["累计计划工作预算费用-BCWS"].ToString());
|
|||
|
acwp = Funs.GetNewDecimalOrZero(dt.Rows[i]["累计已完工作实际费用-ACWP"].ToString());
|
|||
|
bcwp = Funs.GetNewDecimalOrZero(dt.Rows[i]["累计已完工作预算费用-BCWP"].ToString());
|
|||
|
if (bcws == lastbcws)
|
|||
|
{
|
|||
|
if (Funs.GetNewDateTimeOrNow(dt.Rows[i]["Months"].ToString()) > DateTime.Now)
|
|||
|
{
|
|||
|
dt.Rows[i]["累计计划工作预算费用-BCWS"] = 0;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dt.Rows[i]["累计计划工作预算费用-BCWS"] = bcws / 10000;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dt.Rows[i]["累计计划工作预算费用-BCWS"] = bcws / 10000;
|
|||
|
}
|
|||
|
if (acwp == lastacwp)
|
|||
|
{
|
|||
|
if (Funs.GetNewDateTimeOrNow(dt.Rows[i]["Months"].ToString()) > DateTime.Now)
|
|||
|
{
|
|||
|
dt.Rows[i]["累计已完工作实际费用-ACWP"] = 0;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dt.Rows[i]["累计已完工作实际费用-ACWP"] = acwp / 10000;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dt.Rows[i]["累计已完工作实际费用-ACWP"] = acwp / 10000;
|
|||
|
}
|
|||
|
if (bcwp == lastbcwp)
|
|||
|
{
|
|||
|
if (Funs.GetNewDateTimeOrNow(dt.Rows[i]["Months"].ToString()) > DateTime.Now)
|
|||
|
{
|
|||
|
dt.Rows[i]["累计已完工作预算费用-BCWP"] = 0;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dt.Rows[i]["累计已完工作预算费用-BCWP"] = bcwp / 10000;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dt.Rows[i]["累计已完工作预算费用-BCWP"] = bcwp / 10000;
|
|||
|
}
|
|||
|
lastbcws = bcws;
|
|||
|
lastacwp = acwp;
|
|||
|
lastbcwp = bcwp;
|
|||
|
|
|||
|
listCategories.Add(dt.Rows[i]["月份"].ToString());
|
|||
|
if (Funs.GetNewDateTimeOrNow(dt.Rows[i]["Months"].ToString()) <= DateTime.Now)
|
|||
|
{
|
|||
|
listdata.Add(Convert.ToDouble(dt.Rows[i]["本月计划工作预算费用-BCWS"]));
|
|||
|
listdata2.Add(Convert.ToDouble(dt.Rows[i]["累计计划工作预算费用-BCWS"]));
|
|||
|
listdata3.Add(Convert.ToDouble(dt.Rows[i]["本月已完工作预算费用-BCWP"]));
|
|||
|
listdata4.Add(Convert.ToDouble(dt.Rows[i]["累计已完工作预算费用-BCWP"]));
|
|||
|
listdata5.Add(Convert.ToDouble(dt.Rows[i]["本月已完工作实际费用-ACWP"]));
|
|||
|
listdata6.Add(Convert.ToDouble(dt.Rows[i]["累计已完工作实际费用-ACWP"]));
|
|||
|
}
|
|||
|
}
|
|||
|
s.data = listdata;
|
|||
|
s2.data = listdata2;
|
|||
|
s3.data = listdata3;
|
|||
|
s4.data = listdata4;
|
|||
|
s5.data = listdata5;
|
|||
|
s6.data = listdata6;
|
|||
|
series.Add(s);
|
|||
|
series.Add(s2);
|
|||
|
series.Add(s3);
|
|||
|
series.Add(s4);
|
|||
|
series.Add(s5);
|
|||
|
series.Add(s6);
|
|||
|
businessColumn.categories = listCategories;
|
|||
|
businessColumn.series = series;
|
|||
|
}
|
|||
|
return JsonConvert.SerializeObject(businessColumn);
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 人力情况
|
|||
|
protected string Person
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
Model.SGGLDB db = Funs.DB;
|
|||
|
List<Model.SingleSerie> series = new List<Model.SingleSerie>();
|
|||
|
Model.BusinessColumn businessColumn = new Model.BusinessColumn();
|
|||
|
List<string> listCategories = new List<string>();
|
|||
|
var persons = from x in db.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.IsUsed == true && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now) select x;
|
|||
|
var posts = (from x in persons
|
|||
|
join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|||
|
select y).Distinct();
|
|||
|
Model.SingleSerie s = new Model.SingleSerie();
|
|||
|
List<double> listdata = new List<double>();
|
|||
|
//木工
|
|||
|
listCategories.Add("木工");
|
|||
|
int workPostCount1 = persons.Count(x => x.WorkPostId == Const.WorkPost_Carpentry);
|
|||
|
listdata.Add(workPostCount1);
|
|||
|
//钢筋工
|
|||
|
listCategories.Add("钢筋工");
|
|||
|
int workPostCount2 = persons.Count(x => x.WorkPostId == Const.WorkPost_SteelWorker);
|
|||
|
listdata.Add(workPostCount2);
|
|||
|
//瓦工
|
|||
|
listCategories.Add("瓦工");
|
|||
|
int workPostCount3 = persons.Count(x => x.WorkPostId == Const.WorkPost_Bricklayer);
|
|||
|
listdata.Add(workPostCount3);
|
|||
|
//混凝土工
|
|||
|
listCategories.Add("混凝土工");
|
|||
|
int workPostCount4 = persons.Count(x => x.WorkPostId == Const.WorkPost_ConcreteWorker);
|
|||
|
listdata.Add(workPostCount4);
|
|||
|
//钳工
|
|||
|
listCategories.Add("钳工");
|
|||
|
int workPostCount5 = persons.Count(x => x.WorkPostId == Const.WorkPost_Fitter1 || x.WorkPostId == Const.WorkPost_Fitter2);
|
|||
|
listdata.Add(workPostCount5);
|
|||
|
//焊工
|
|||
|
listCategories.Add("焊工");
|
|||
|
int workPostCount6 = persons.Count(x => x.WorkPostId == Const.WorkPost_Welder1 || x.WorkPostId == Const.WorkPost_Welder2 ||
|
|||
|
x.WorkPostId == Const.WorkPost_Welder3 || x.WorkPostId == Const.WorkPost_Welder4 || x.WorkPostId == Const.WorkPost_Welder5);
|
|||
|
listdata.Add(workPostCount6);
|
|||
|
//铆工
|
|||
|
listCategories.Add("铆工");
|
|||
|
int workPostCount7 = persons.Count(x => x.WorkPostId == Const.WorkPost_Riveter);
|
|||
|
listdata.Add(workPostCount7);
|
|||
|
//管工
|
|||
|
listCategories.Add("管工");
|
|||
|
int workPostCount8 = persons.Count(x => x.WorkPostId == Const.WorkPost_Foreman);
|
|||
|
listdata.Add(workPostCount8);
|
|||
|
//电工
|
|||
|
listCategories.Add("电工");
|
|||
|
int workPostCount9 = persons.Count(x => x.WorkPostId == Const.WorkPost_Electrician1 || x.WorkPostId == Const.WorkPost_Electrician2
|
|||
|
|| x.WorkPostId == Const.WorkPost_Electrician3);
|
|||
|
listdata.Add(workPostCount9);
|
|||
|
//仪表工
|
|||
|
listCategories.Add("仪表工");
|
|||
|
int workPostCount10 = persons.Count(x => x.WorkPostId == Const.WorkPost_Instrumentalist);
|
|||
|
listdata.Add(workPostCount10);
|
|||
|
//防腐保温工
|
|||
|
listCategories.Add("防腐保温工");
|
|||
|
int workPostCount11 = persons.Count(x => x.WorkPostId == Const.WorkPost_AnticorrosionWorker);
|
|||
|
listdata.Add(workPostCount11);
|
|||
|
//防腐保温工
|
|||
|
listCategories.Add("管理人员");
|
|||
|
int workPostCount12 = (from x in persons
|
|||
|
join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|||
|
where y.PostType == Const.PostType_1
|
|||
|
select x).Count();
|
|||
|
listdata.Add(workPostCount12);
|
|||
|
//其他
|
|||
|
listCategories.Add("其他");
|
|||
|
int workPostCount13 = persons.Count() - workPostCount1 - workPostCount2 - workPostCount3 - workPostCount4 - workPostCount5 - workPostCount6 - workPostCount7
|
|||
|
- workPostCount8 - workPostCount9 - workPostCount10 - workPostCount11 - workPostCount12;
|
|||
|
listdata.Add(workPostCount13);
|
|||
|
s.data = listdata;
|
|||
|
series.Add(s);
|
|||
|
businessColumn.categories = listCategories;
|
|||
|
businessColumn.title = persons.Count().ToString();
|
|||
|
businessColumn.series = series;
|
|||
|
return JsonConvert.SerializeObject(businessColumn);
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 作业许可列表
|
|||
|
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)
|
|||
|
{
|
|||
|
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>";
|
|||
|
}
|
|||
|
return returnHtml;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 工作台面
|
|||
|
protected void getGztm() {
|
|||
|
div_dbsxlist.InnerHtml = "";
|
|||
|
//关键事项
|
|||
|
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);
|
|||
|
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>";
|
|||
|
}
|
|||
|
div_dbsxlist.InnerHtml = returnHtml;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 关闭弹出窗
|
|||
|
/// </summary>
|
|||
|
/// <param name="sender"></param>
|
|||
|
/// <param name="e"></param>
|
|||
|
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
|||
|
{
|
|||
|
getGztm();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 打开待办
|
|||
|
/// </summary>
|
|||
|
/// <param name="sender"></param>
|
|||
|
/// <param name="e"></param>
|
|||
|
protected void btnshowWindows(object sender, EventArgs e)
|
|||
|
{
|
|||
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("{0}", hiddenUrl.Value, "办理 - ")));
|
|||
|
}
|
|||
|
|
|||
|
#region 材料到货
|
|||
|
protected string gdclHtml;
|
|||
|
protected string sbclHtml;
|
|||
|
|
|||
|
protected string gdclHead = "<div class=\"trth\" style=\"background: rgba(33, 55, 113, .4);\"><div class=\"th r-line\" style=\"width: .7875rem;\"><p>材料类别</p></div><div class=\"th r-line\" style=\"width: .8375rem;\"><p>设计量</p></div><div class=\"th r-line\" style=\"width: 1.575rem;\"><p class=\"b-line\">采购量</p><p><span class=\"r-line\">采购量</span><span class=\"r-line\">百分比</span></p></div><div class=\"th r-line\" style=\"width: 1.575rem;\"><p class=\"b-line\">到货量</p><p><span class=\"r-line\">已到货</span><span class=\"r-line\">百分比</span></p></div><div class=\"th\" style=\"width: 1.575rem;\"><p class=\"b-line\">领料量</p><p><span class=\"r-line\">已领料</span><span>百分比</span></p></div></div>";
|
|||
|
protected string sbclHead = "<div class=\"trth\" style=\"background: rgba(33, 55, 113, .4);\"><div class=\"th r-line\" style=\"width: 2.9875rem;\"><p>合同号</p></div>" +
|
|||
|
"<div class=\"th r-line\" style=\"width: .7875rem;\"><p>采购总量</p></div>" +
|
|||
|
"<div class=\"th r-line\" style=\"width: .7875rem;\"><p>发货总量</p></div>" +
|
|||
|
"<div class=\"th r-line\" style=\"width: .7875rem;\"><p>到货总量</p></div>" +
|
|||
|
"<div class=\"th r-line\" style=\"width: .9875rem;\"><p>到货百分比</p></div>";
|
|||
|
private void getCldh()
|
|||
|
{
|
|||
|
//管道材料
|
|||
|
var pid = BLL.ProjectService.GetCLProjectCodeByProjectId(ProjectId).ToString();
|
|||
|
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; \">" + (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.C9) ? "0%" : item.C9) + "</span>";
|
|||
|
gdclHtml += "</div>";
|
|||
|
}
|
|||
|
|
|||
|
//设备材料
|
|||
|
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "设备"&&x.ProjectId==pid);
|
|||
|
foreach (var item in SbclList)
|
|||
|
{
|
|||
|
sbclHtml += "<div class=\"tr\">";
|
|||
|
double SbcllCgl = 0.0;
|
|||
|
double Sbdhs = 0.0;
|
|||
|
if (string.IsNullOrEmpty(item.C7))
|
|||
|
{
|
|||
|
SbcllCgl += 0;
|
|||
|
Sbdhs += 0;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
SbcllCgl += Convert.ToDouble(item.C7);
|
|||
|
Sbdhs += Convert.ToDouble(item.C9);
|
|||
|
}
|
|||
|
sbclHtml += "<span class=\"r-line\" style=\"width: 2.9875rem; \">" + item.C2 + "</span>";
|
|||
|
sbclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + SbcllCgl + "</span>";
|
|||
|
sbclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + item.C7 + "</span>";
|
|||
|
sbclHtml += "<span class=\"r-line\" style=\"width: .7875rem; \">" + Sbdhs + "</span>";
|
|||
|
//百分比
|
|||
|
var dhbfb = "0%";
|
|||
|
if (SbcllCgl + Sbdhs != 0)
|
|||
|
{
|
|||
|
dhbfb = String.Format("{0:N2}", 100.0 * Sbdhs / (Sbdhs + SbcllCgl), 2) + "%";
|
|||
|
|
|||
|
}
|
|||
|
sbclHtml += "<span class=\"r-line\" style=\"width: .9875rem; \">" + dhbfb + "</span>";
|
|||
|
sbclHtml += "</div>";
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|