2023-08-25 09:52:24 +08:00
using BLL ;
2023-10-12 19:33:22 +08:00
using FineUIPro.Web.BaseInfo ;
using FineUIPro.Web.DataShow ;
using FineUIPro.Web.SysManage ;
using Model ;
2023-08-25 09:52:24 +08:00
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 ;
}
2023-09-04 16:20:02 +08:00
2023-08-25 09:52:24 +08:00
}
/// <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 ;
//安全人工时
2023-09-04 16:20:02 +08:00
int wHours = db . SitePerson_PersonInOutNumber . Where ( x = > x . ProjectId = = ProjectId ) . Max ( x = > x . WorkHours ) ? ? 0 ;
2023-08-25 09:52:24 +08:00
this . divSafeWorkTime . InnerHtml = wHours . ToString ( ) ;
//本月安全人工时
2023-08-28 18:26:38 +08:00
int wHoursMonth = 0 ;
2023-09-04 16:20:02 +08:00
DateTime ? sDate = Funs . GetNewDateTime ( DateTime . Now . Year . ToString ( ) + "-" + DateTime . Now . Month . ToString ( ) ) ;
2023-08-28 18:26:38 +08:00
var dayReports = BLL . SitePerson_MonthReportService . getMonthReports ( this . ProjectId , sDate ) ;
2023-09-04 16:20:02 +08:00
if ( dayReports . Count > 0 )
2023-08-28 18:26:38 +08:00
{
wHoursMonth = Convert . ToInt32 ( dayReports [ 0 ] . DayWorkTime ) ;
}
2023-08-25 09:52:24 +08:00
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
2023-10-20 17:25:08 +08:00
where x . ProjectId = = ProjectId & & x . IsUsed = = true & & x . InTime < = DateTime . Now & & ( ! x . OutTime . HasValue | | x . OutTime . Value > DateTime . Now )
2023-08-25 09:52:24 +08:00
select x ;
2023-10-20 17:25:08 +08:00
2023-08-25 09:52:24 +08:00
var glAllPerson = from x in allSum
join y in Funs . DB . Base_WorkPost on x . WorkPostId equals y . WorkPostId
2023-10-20 17:25:08 +08:00
where y . IsHsse = = true & & x . ProjectId = = ProjectId //安管人员
2023-08-25 09:52:24 +08:00
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 ( ) ;
2023-09-04 16:20:02 +08:00
div_sgfaSpl . InnerHtml = sgspl . ToString ( ) ;
2023-10-12 19:33:22 +08:00
GetJD ( ) ;
2023-08-25 09:52:24 +08:00
//质量共检
getZlgj ( ) ;
//焊接
getHj ( ) ;
//加载质量问题
getZlwt ( ) ;
//人员信息
getSitePerson ( ) ;
//项目人员图表
getProjectSitePerson ( ) ;
//工作台面
2023-09-04 16:20:02 +08:00
getGjsx ( ) ;
2023-08-25 09:52:24 +08:00
getGztm ( ) ;
//材料到货
getCldh ( ) ;
}
}
#region 人 员 信 息
private void getSitePerson ( )
{
int AllCount = 0 ;
int MCount = 0 ;
2023-09-04 16:20:02 +08:00
var getallin = APIPageDataService . getPersonNum ( ProjectId , DateTime . Now ) ;
2023-08-25 09:52:24 +08:00
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
2023-09-04 16:20:02 +08:00
& & x . ProjectId = = ProjectId ) . ToList ( ) ;
2023-08-25 09:52:24 +08:00
foreach ( var item in list )
{
ProjectPersonMc + = "'" + item . ShortName + "'," ;
ProjectPersonCount + = "'" + APIPageDataService . getPersonNum ( item . ProjectId , DateTime . Now ) . Count ( ) + "'," ;
}
2023-09-04 16:20:02 +08:00
if ( ! string . IsNullOrEmpty ( ProjectPersonMc ) & & ! string . IsNullOrEmpty ( ProjectPersonCount ) )
2023-08-25 09:52:24 +08:00
{
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 ( ) ;
2023-09-27 09:10:09 +08:00
div_zgwcl . InnerHtml = String . Format ( "{0:N2}" , 100.0 * GetGeneralClosedNum ( ) / ( GetGeneralNotClosedNum ( ) + GetGeneralClosedNum ( ) ) ) . Replace ( "NaN" , "0" ) + "%" ;
2023-08-25 09:52:24 +08:00
}
/// <summary>
/// 获取隐患整改闭环项
/// </summary>
/// <returns></returns>
2023-09-04 16:20:02 +08:00
public int GetGeneralClosedNum ( )
2023-08-25 09:52:24 +08:00
{
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>
2023-09-04 16:20:02 +08:00
public int GetGeneralNotClosedNum ( )
2023-08-25 09:52:24 +08:00
{
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 = "" ;
2023-09-21 17:42:56 +08:00
divProjectImg = "<div class=\"swiper-slide\"><img src=\"./imags/16.png\"></div>" ;
2023-08-25 09:52:24 +08:00
var project = ProjectService . GetProjectByProjectId ( this . ProjectId ) ;
if ( project ! = null )
{
spanProjectName = "<span title='" + project . ShortName + "'>" + project . ShortName + "</span>" ;
2023-09-04 16:20:02 +08:00
spanRemark = "<span title='" + project . Remark + "'>" + project . Remark + "</span>" ;
2023-08-25 09:52:24 +08:00
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>" ;
}
}
}
2023-09-21 17:42:56 +08:00
var allowExtensions = new List < string >
{
"jpg" , "jpeg" , "png" , "bmp" , "gif" , // 图片文件类型
} ;
2023-08-25 09:52:24 +08:00
var getImag = Funs . DB . AttachFile . FirstOrDefault ( x = > x . ToKeyId = = project . ProjectId ) ;
if ( getImag ! = null & & ! string . IsNullOrEmpty ( getImag . AttachUrl ) )
{
string url = getImag . AttachUrl . Replace ( '\\' , '/' ) ;
2023-09-21 17:42:56 +08:00
var UrlList = Funs . GetStrListByStr ( url , ',' ) ;
2023-10-12 19:33:22 +08:00
bool isHiddDefaultImg = false ;
2023-09-21 17:42:56 +08:00
foreach ( var item in UrlList )
{
if ( ! string . IsNullOrEmpty ( item ) )
{
string atturl = Funs . RootPath + item . Replace ( ';' , ' ' ) . Trim ( ) ;
string fileType = GetFileType ( atturl ) ;
if ( File . Exists ( atturl ) & & allowExtensions . Contains ( fileType ) )
{
2023-10-12 19:33:22 +08:00
isHiddDefaultImg = true ;
2023-09-21 17:42:56 +08:00
divProjectImg + = string . Format ( " <div class=\"swiper-slide\"><img src=\"{0}\"></div>" , atturl . Replace ( Funs . RootPath , "/" ) ) ;
//this.divProjectImgs.Src = divProjectImg;
}
}
}
2023-10-12 19:33:22 +08:00
divProjectImg = divProjectImg . Replace ( "<div class=\"swiper-slide\"><img src=\"./imags/16.png\"></div>" , "" ) ;
2023-09-21 17:42:56 +08:00
/ * string firtstUrl = Funs . GetStrListByStr ( url , ',' ) . FirstOrDefault ( ) ;
2023-08-25 09:52:24 +08:00
if ( ! string . IsNullOrEmpty ( firtstUrl ) )
{
string atturl = Funs . RootPath + firtstUrl . Replace ( ';' , ' ' ) . Trim ( ) ;
if ( File . Exists ( atturl ) )
{
divProjectImg = "../" + firtstUrl . Replace ( ';' , ' ' ) . Trim ( ) ;
//this.divProjectImgs.Src = divProjectImg;
}
2023-09-21 17:42:56 +08:00
} * /
2023-08-25 09:52:24 +08:00
}
}
}
2023-09-21 17:42:56 +08:00
private string GetFileType ( string fileName )
{
string fileType = String . Empty ;
int lastDotIndex = fileName . LastIndexOf ( "." ) ;
if ( lastDotIndex > = 0 )
{
fileType = fileName . Substring ( lastDotIndex + 1 ) . ToLower ( ) ;
}
2023-08-25 09:52:24 +08:00
2023-09-21 17:42:56 +08:00
return fileType ;
}
2023-08-25 09:52:24 +08:00
#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
2023-09-04 16:20:02 +08:00
where x . LimitDate . HasValue & & x . LimitDate < DateTime . Now & & y . ProjectId = = ProjectId
2023-08-25 09:52:24 +08:00
select x ;
//// 预警人数
allCount = getPersonQualitys . Count ( ) ;
return allCount . ToString ( ) ;
}
/// <summary>
/// 机械预警
/// </summary>
/// <returns></returns>
2023-09-04 16:20:02 +08:00
protected int GetJxyjNum ( )
2023-08-25 09:52:24 +08:00
{
int result = 0 ;
//机具报验的到期提醒和过期提醒记录数加一起
//机具报验的到期提醒数
2023-09-04 16:20:02 +08:00
var num1 = Funs . DB . Comprehensive_InspectionMachine . Where ( x = > x . IsOnSite = = true & & DateTime . Now < x . NextTestDate & & x . ProjectId = = ProjectId
2023-08-25 09:52:24 +08:00
& & ( ( 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 作 业 许 可
2023-09-27 09:10:09 +08:00
protected int getTodayCount ( )
{
2023-10-12 19:33:22 +08:00
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId & & x . WorkStatesStr = = "作业中" ) . ToList ( ) . Count ;
2023-09-27 09:10:09 +08:00
return result ;
}
protected int getAllCount ( )
{
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId ) . ToList ( ) . Count ;
return result ;
}
2023-08-25 09:52:24 +08:00
/// <summary>
/// 动火作业许可证
/// </summary>
/// <returns></returns>
2023-09-04 16:20:02 +08:00
protected int getWrokCount0 ( )
{
2023-10-12 19:33:22 +08:00
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId & & x . LicenseTypeName = = "动火作业许可证" & & x . WorkStatesStr = = "作业中" ) . ToList ( ) . Count ;
2023-08-25 09:52:24 +08:00
return result ;
}
2023-10-20 17:25:08 +08:00
protected int getALLWrokCount0 ( )
{
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId & & x . LicenseTypeName = = "动火作业许可证" ) . ToList ( ) . Count ;
return result ;
}
2023-08-25 09:52:24 +08:00
protected int getWrokCount1 ( )
{
2023-10-12 19:33:22 +08:00
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId & & x . LicenseTypeName = = "高处作业许可证" & & x . WorkStatesStr = = "作业中" ) . ToList ( ) . Count ;
2023-08-25 09:52:24 +08:00
return result ;
}
2023-10-20 17:25:08 +08:00
protected int getALLWrokCount1 ( )
{
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId & & x . LicenseTypeName = = "高处作业许可证" ) . ToList ( ) . Count ;
return result ;
}
2023-08-25 09:52:24 +08:00
protected int getWrokCount2 ( )
{
2023-10-12 19:33:22 +08:00
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId & & x . LicenseTypeName = = "吊装作业许可证" & & x . WorkStatesStr = = "作业中" ) . ToList ( ) . Count ;
2023-08-25 09:52:24 +08:00
return result ;
}
2023-10-20 17:25:08 +08:00
protected int getALLWrokCount2 ( )
{
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId & & x . LicenseTypeName = = "吊装作业许可证" ) . ToList ( ) . Count ;
return result ;
}
2023-08-25 09:52:24 +08:00
protected int getWrokCount3 ( )
{
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId
2023-10-12 19:33:22 +08:00
& & x . LicenseTypeName ! = "动火作业许可证" & & x . LicenseTypeName ! = "高处作业许可证" & & x . LicenseTypeName ! = "吊装作业许可证" & & x . WorkStatesStr = = "作业中" ) . ToList ( ) . Count ;
2023-08-25 09:52:24 +08:00
return result ;
2023-10-20 17:25:08 +08:00
}
protected int getALLWrokCount3 ( )
{
var result = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId
& & x . LicenseTypeName ! = "动火作业许可证" & & x . LicenseTypeName ! = "高处作业许可证" & & x . LicenseTypeName ! = "吊装作业许可证" ) . ToList ( ) . Count ;
return result ;
2023-08-25 09:52:24 +08:00
}
#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
2023-09-04 16:20:02 +08:00
where x . CheckDate < = DateTime . Now & & x . ProjectId = = ProjectId
2023-08-25 09:52:24 +08:00
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 ) ) ;
2023-10-12 19:33:22 +08:00
zlzgl = zgl . ToString ( ) . Replace ( "NaN" , "0" ) ;
2023-08-25 09:52:24 +08:00
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 ( ) ;
}
2023-09-04 16:20:02 +08:00
else
{
2023-08-25 09:52:24 +08:00
zlgjzgl = zgl . ToString ( ) ;
zggjzglDataValue = "0" ;
}
2023-09-04 16:20:02 +08:00
2023-08-25 09:52:24 +08:00
}
#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
2023-09-04 16:20:02 +08:00
& & a . ProjectId = = ProjectId
2023-08-25 09:52:24 +08:00
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"
2023-09-04 16:20:02 +08:00
& & a . ProjectId = = ProjectId
2023-08-25 09:52:24 +08:00
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 赢 得 值 曲 线
2023-10-12 19:33:22 +08:00
protected string swgclHtml ;
protected void GetJD ( )
{
int index = 0 ;
var result = Funs . DB . View_JDGL_QuantityCompletion
. Where ( qc = > qc . ProjectId = = this . CurrUser . LoginProjectId )
. OrderBy ( qc = > qc . SortIndex )
. ThenBy ( qc = > qc . Name )
. ToList ( ) ;
foreach ( var item in result )
{
2023-10-19 21:44:34 +08:00
index + + ;
2023-10-12 19:33:22 +08:00
swgclHtml + = "<div class=\"tr1\">" ;
swgclHtml + = string . Format ( "<div class=\"th r-line\" style=\"width: .625rem;\"><p>{0}</p></div>" , index ) ;
swgclHtml + = string . Format ( "<div class=\"th r-line\" style=\"width: 1rem;\"><p>{0}</p> </div>" , item . Name ) ;
swgclHtml + = string . Format ( "<div class=\"th r-line\" style=\"width: .8375rem;\"><p>{0}</p> </div>" , item . Unit ) ;
swgclHtml + = string . Format ( " <div class=\"th r-line\" style=\"width: .8375rem;\"><p>{0}</p> </div>" , item . DesignNum ) ;
swgclHtml + = string . Format ( "<div class=\"th r-line\" style=\"width: 2.325rem;\"><p><span class=\"r-line s1\">{0}</span><span class=\"r-line s1\">{1}</span><span class=\"r-line s1\" style=\"border: none;\">{2}</span></p> </div>" , item . PlanNum , item . RealNum , item . Rate ) ;
swgclHtml + = string . Format ( " <div class=\"th r-line \" style=\"width: 2.325rem;\"><p><span class=\"r-line s1\">{0}</span><span class=\"r-line s1\">{1}</span><span class=\"r-line s1\" style=\"border: none;\">{2}</span></p> </div>" , item . TotalPlanNum , item . TotalRealNum , item . TotalRate ) ;
swgclHtml + = string . Format ( "<div class=\"th r-line\" style=\"width: .8375rem;\"><p>{0}</p> </div>" , item . SumRate ) ;
swgclHtml + = " </div>" ;
}
}
2023-08-25 09:52:24 +08:00
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 作 业 许 可 列 表
2023-09-04 16:20:02 +08:00
protected string getLicenseManager ( )
{
2023-08-25 09:52:24 +08:00
string returnHtml = "" ;
var list = Funs . DB . View_License_LicenseManager . Where ( x = > x . ProjectId = = ProjectId ) . ToList ( ) ;
foreach ( var item in list )
{
var gfx = "风险作业" ;
2023-09-04 16:20:02 +08:00
if ( item . IsHighRisk ! = true )
2023-08-25 09:52:24 +08:00
{
gfx = "非高风险" ;
}
var shortUnitname = Funs . DB . Base_Unit . Where ( x = > x . UnitId = = item . UnitId ) . FirstOrDefault ( ) . ShortUnitName ;
2023-09-04 16:20:02 +08:00
returnHtml + = "<div class=\"li\">" + item . LicenseManagerCode + "-" + shortUnitname + "-" + item . WorkAreaName + "-" + gfx + "-" + item . LicenseTypeName
+ "</div>" ;
2023-08-25 09:52:24 +08:00
}
return returnHtml ;
}
#endregion
#region 工 作 台 面
2023-09-04 16:20:02 +08:00
2023-10-12 19:33:22 +08:00
protected string gjsxRate = "0" ;
2023-09-04 16:20:02 +08:00
protected void getGztm ( )
{
//div_dbsxlist.InnerHtml = "";
string returnDbHtml = "<div></div>" ;
if ( ! string . IsNullOrEmpty ( ProjectId ) )
{
//关键事项
string strSql = @ "SELECT GJSXID AS DataId
2023-08-25 09:52:24 +08:00
, ' 0 BEA2126 - 7 A48 - 40 EB - 8E21 - 99148E91 A22B ' 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 ) )
) ";
2023-09-04 16:20:02 +08:00
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 ( ) ;
foreach ( var item in getDataList )
{
2023-09-12 15:20:29 +08:00
returnDbHtml + = "<div class=\"li\" style=\"cursor:pointer\" onclick=\"returnWindows('" + item . PCUrl + "')\"><span>" + item . MenuName + "</span><span>" + item . Content + "</span><span>" +
2023-09-04 16:20:02 +08:00
item . DataTime . ToString ( ) . Replace ( '/' , '-' ) . Split ( ' ' ) [ 0 ] + "</span></div>" ;
}
}
else {
returnDbHtml = "<div></div>" ;
}
this . div_dbsxlist . InnerHtml = returnDbHtml ;
}
/// <summary>
/// 加载关键事项
/// </summary>
protected void getGjsx ( )
{
string returnDbHtml = "<div></div>" ;
////关键事项
if ( ! string . IsNullOrEmpty ( ProjectId ) )
2023-08-25 09:52:24 +08:00
{
2023-09-04 16:20:02 +08:00
string strSql = @ "SELECT GJSXID AS DataId
, ' 0 BEA2126 - 7 A48 - 40 EB - 8E21 - 99148E91 A22B ' 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>" ;
}
2023-08-25 09:52:24 +08:00
}
2023-09-04 16:20:02 +08:00
else
{
returnDbHtml = "<div></div>" ;
}
this . div_gjsxlist . InnerHtml = returnDbHtml ;
2023-10-12 19:33:22 +08:00
List < SqlParameter > listStaticListStr = new List < SqlParameter > ( ) ;
listStaticListStr . Add ( new SqlParameter ( "@UserID" , null ) ) ;
listStaticListStr . Add ( new SqlParameter ( "@unit" , null ) ) ;
listStaticListStr . Add ( new SqlParameter ( "@projectid" , this . CurrUser . LoginProjectId ) ) ;
listStaticListStr . Add ( new SqlParameter ( "@CNProfessional_ID" , null ) ) ;
listStaticListStr . Add ( new SqlParameter ( "@questionType" , null ) ) ;
listStaticListStr . Add ( new SqlParameter ( "@processMan" , null ) ) ; listStaticListStr . Add ( new SqlParameter ( "@User_Acceptance" , null ) ) ;
2023-09-04 16:20:02 +08:00
2023-10-12 19:33:22 +08:00
SqlParameter [ ] Staticparameter = listStaticListStr . ToArray ( ) ;
DataTable statcitbDataTable = SQLHelper . GetDataTableRunProc ( "Sp_GJSXStatistic" , Staticparameter ) ;
var allcount = Funs . GetNewIntOrZero ( statcitbDataTable . Rows [ 0 ] [ "allcount" ] . ToString ( ) ) ;
var closecount = Funs . GetNewIntOrZero ( statcitbDataTable . Rows [ 0 ] [ "closecount" ] . ToString ( ) ) ;
gjsxRate = String . Format ( "{0:N2}" , 100.0 * closecount / allcount ) ;
gjsxRate = gjsxRate . ToString ( ) . Replace ( "NaN" , "0" ) + "%" ;
2023-08-25 09:52:24 +08:00
}
#endregion
/// <summary>
/// 关闭弹出窗
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close ( object sender , WindowCloseEventArgs e )
{
getGztm ( ) ;
2023-09-04 16:20:02 +08:00
getGjsx ( ) ;
2023-08-25 09:52:24 +08:00
}
2023-09-04 16:20:02 +08:00
2023-08-25 09:52:24 +08:00
/// <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 ( ) ;
2023-09-04 16:20:02 +08:00
var list = Funs . DB . CLGL_PipelineMaterialSumList . Where ( x = > x . Type = = "M" & & x . ProjectId = = pid ) ;
2023-08-25 09:52:24 +08:00
foreach ( var item in list )
{
gdclHtml + = "<div class=\"tr\">" ;
2023-09-04 16:20:02 +08:00
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>" ;
2023-08-25 09:52:24 +08:00
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>" ;
2023-09-04 16:20:02 +08:00
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>" ;
2023-08-25 09:52:24 +08:00
gdclHtml + = "<span class=\"r-line\" style=\"width: .7875rem; \">" + ( string . IsNullOrEmpty ( item . C9 ) ? "0%" : item . C9 ) + "</span>" ;
gdclHtml + = "</div>" ;
}
//设备材料
2023-09-04 16:20:02 +08:00
var SbclList = Funs . DB . CLGL_ContractListSum . Where ( x = > x . C1 = = "设备" & & x . ProjectId = = pid ) ;
2023-08-25 09:52:24 +08:00
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 )
{
2023-09-04 16:20:02 +08:00
dhbfb = String . Format ( "{0:N2}" , 100.0 * Sbdhs / ( Sbdhs + SbcllCgl ) , 2 ) + "%" ;
2023-08-25 09:52:24 +08:00
}
sbclHtml + = "<span class=\"r-line\" style=\"width: .9875rem; \">" + dhbfb + "</span>" ;
sbclHtml + = "</div>" ;
}
}
#endregion
}
}