公司级增加项目筛选,开车看板修改
This commit is contained in:
@@ -13,11 +13,19 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
List<Model.Base_Project> allProjects;
|
||||
public static List<Model.Solution_LargerHazard> LargerHazard = new List<Model.Solution_LargerHazard>();
|
||||
|
||||
public string[] pids { get; set; }
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
if (!string.IsNullOrEmpty(CurrUser.CompanyProjectId))
|
||||
{
|
||||
pids = CurrUser.CompanyProjectId.Split(',');
|
||||
}
|
||||
|
||||
|
||||
//未遂事故
|
||||
var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
|
||||
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
@@ -31,7 +39,26 @@ namespace FineUIPro.Web.common
|
||||
|
||||
//安全人工时
|
||||
int wHours = db.SitePerson_PersonInOutNumber.Max(x => x.WorkHours) ?? 0;
|
||||
this.divSafeWorkTime.InnerHtml = CountAqrgs().ToString().Split('.')[0];
|
||||
var countAqrgsSum = Convert.ToDecimal(0);
|
||||
if (pids == null)
|
||||
{
|
||||
countAqrgsSum = CountAqrgs();
|
||||
}
|
||||
else {
|
||||
countAqrgsSum = CountAqrgs(null,null,pids);
|
||||
}
|
||||
|
||||
if (countAqrgsSum > 10000)
|
||||
{
|
||||
countAqrgsSum = countAqrgsSum / Convert.ToDecimal(10000.00);
|
||||
|
||||
this.divSafeWorkTime.InnerHtml = Math.Round(countAqrgsSum, 2).ToString() + "万";
|
||||
}
|
||||
else {
|
||||
this.divSafeWorkTime.InnerHtml = countAqrgsSum.ToString().Split('.')[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//本月安全人工时
|
||||
//int wHoursMonth = 0;
|
||||
@@ -43,50 +70,125 @@ namespace FineUIPro.Web.common
|
||||
//}
|
||||
DateTime d1 = getStartMonth();
|
||||
DateTime d2 = getEndMonth();
|
||||
var countMonthAqrgs = Convert.ToDecimal(0);
|
||||
if (pids == null)
|
||||
{
|
||||
countMonthAqrgs = CountAqrgs(d1, d2);
|
||||
}
|
||||
else
|
||||
{
|
||||
countMonthAqrgs = CountAqrgs(d1, d2,pids);
|
||||
}
|
||||
if (countMonthAqrgs > 10000)
|
||||
{
|
||||
countMonthAqrgs = countMonthAqrgs / Convert.ToDecimal(10000.00);
|
||||
|
||||
this.divSafeWorkTimeMonth.InnerHtml = Math.Round(countMonthAqrgs, 2).ToString() + "万";
|
||||
}
|
||||
else {
|
||||
this.divSafeWorkTimeMonth.InnerHtml = CountAqrgs(d1, d2).ToString().Split('.')[0];
|
||||
}
|
||||
|
||||
|
||||
this.divSafeWorkTimeMonth.InnerHtml = CountAqrgs(d1, d2).ToString().Split('.')[0];
|
||||
|
||||
//int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day)))
|
||||
// .Max(x => x.WorkHours) ?? 0;
|
||||
//this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
|
||||
|
||||
//安全培训累计人员
|
||||
var getTrainRecord = db.EduTrain_TrainRecord.Sum(x => x.TrainPersonNum) ?? 0;
|
||||
//修改:增加博晟教育中的人数
|
||||
var boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)).ToList().Count;
|
||||
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
|
||||
var getTrainRecord = 0;
|
||||
var boShengCount = 0;
|
||||
if (pids == null)
|
||||
{
|
||||
getTrainRecord = db.EduTrain_TrainRecord.Sum(x => x.TrainPersonNum) ?? 0;
|
||||
//修改:增加博晟教育中的人数
|
||||
boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)).ToList().Count;
|
||||
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
|
||||
}
|
||||
else {
|
||||
getTrainRecord = db.EduTrain_TrainRecord.Where(x=>pids.Contains(x.ProjectId)).Sum(x => x.TrainPersonNum) ?? 0;
|
||||
//修改:增加博晟教育中的人数
|
||||
boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)
|
||||
&& pids.Contains(x.ProjectId) ).ToList().Count;
|
||||
|
||||
//安全管理人员
|
||||
var allSum = from x in Funs.DB.SitePerson_Person
|
||||
where x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now)
|
||||
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") //一般管理岗位和特种管理人员
|
||||
where y.IsHsse == true
|
||||
select x;
|
||||
this.divSafeManagePersonNum.InnerText = glAllPerson.Count().ToString();
|
||||
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
|
||||
}
|
||||
|
||||
//质量管理人员
|
||||
int CqmsManageNum = (from x in Funs.DB.Person_CompanyBranchPerson
|
||||
|
||||
if (pids == null)
|
||||
{
|
||||
//安全管理人员
|
||||
var allSum = from x in Funs.DB.SitePerson_Person
|
||||
where x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now)
|
||||
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") //一般管理岗位和特种管理人员
|
||||
where y.IsHsse == true
|
||||
select x;
|
||||
this.divSafeManagePersonNum.InnerText = glAllPerson.Count().ToString();
|
||||
}
|
||||
else {
|
||||
//安全管理人员
|
||||
var allSum = from x in Funs.DB.SitePerson_Person
|
||||
where x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now)
|
||||
&& pids.Contains(x.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") //一般管理岗位和特种管理人员
|
||||
where y.IsHsse == true
|
||||
select x;
|
||||
this.divSafeManagePersonNum.InnerText = glAllPerson.Count().ToString();
|
||||
}
|
||||
|
||||
#region 质量管理人员,质量培训人员 增加公司级
|
||||
int CqmsManageNum = 0;
|
||||
int CqmsPxNum = 0;
|
||||
//质量培训人员
|
||||
DateTime date = DateTime.Now.AddDays(-1);
|
||||
if (pids == null)
|
||||
{
|
||||
CqmsManageNum = (from x in Funs.DB.Person_CompanyBranchPerson
|
||||
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
where x.IsOnJob == true && y.IsCQMS == true
|
||||
select x).Count() +
|
||||
(from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
where x.IsUsed == true && y.IsCQMS == true
|
||||
select x).Count();
|
||||
this.divCqmsManageNum.InnerText = CqmsManageNum.ToString();
|
||||
(from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
where x.IsUsed == true && y.IsCQMS == true
|
||||
select x).Count();
|
||||
this.divCqmsManageNum.InnerText = CqmsManageNum.ToString();
|
||||
|
||||
//质量培训人员
|
||||
DateTime date = DateTime.Now.AddDays(-1);
|
||||
int CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.IsTrain == true
|
||||
select x).Count();
|
||||
divCqmsPxNum.InnerText = CqmsPxNum.ToString();
|
||||
divCqmsPxNum.InnerText = CqmsPxNum.ToString();
|
||||
}
|
||||
else {
|
||||
CqmsManageNum = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
where x.IsUsed == true && y.IsCQMS == true && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
this.divCqmsManageNum.InnerText = CqmsManageNum.ToString();
|
||||
|
||||
CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.IsTrain == true && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
divCqmsPxNum.InnerText = CqmsPxNum.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
//在建项目
|
||||
allProjects = ProjectService.GetAllProjectDropDownList();
|
||||
if (pids == null)
|
||||
{
|
||||
allProjects = ProjectService.GetAllProjectDropDownList();
|
||||
}
|
||||
else {
|
||||
allProjects = ProjectService.GetAllProjectDropDownList(pids);
|
||||
}
|
||||
|
||||
int acount = allProjects.Count();
|
||||
int pcount1 = 0;
|
||||
int pcount2 = 0;
|
||||
@@ -94,8 +196,15 @@ namespace FineUIPro.Web.common
|
||||
if (acount > 0)
|
||||
{
|
||||
pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Count();
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true select x).Count();
|
||||
pcount3 = Count3();
|
||||
var pidzjsg = string.Join(",", allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId)).Split(',');
|
||||
if (pids == null) {
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pidzjsg.Contains(x.ProjectId) select x).Count();
|
||||
}
|
||||
else {
|
||||
pidzjsg = pids;
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pids.Contains(x.ProjectId) select x).Count();
|
||||
}
|
||||
pcount3 = Count3(pidzjsg);
|
||||
}
|
||||
div_zjxmCount.InnerHtml = pcount1.ToString() + "<div class=\"th\">个</div>";
|
||||
div_cjrsCount.InnerHtml = pcount2.ToString() + "<div class=\"th\">人</div>";
|
||||
@@ -162,7 +271,7 @@ namespace FineUIPro.Web.common
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected decimal CountAqrgs(DateTime? d1 = null, DateTime? d2 = null)
|
||||
protected decimal CountAqrgs(DateTime? d1 = null, DateTime? d2 = null,string[] pids =null)
|
||||
{
|
||||
decimal cout1 = 0;
|
||||
|
||||
@@ -171,7 +280,12 @@ namespace FineUIPro.Web.common
|
||||
var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
|
||||
|
||||
select x;
|
||||
if (getAllPersonInOutList.Count() > 0)
|
||||
if (pids != null) {
|
||||
getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
|
||||
where pids.Contains(x.ProjectId)
|
||||
select x;
|
||||
}
|
||||
if (getAllPersonInOutList.Count() > 0)
|
||||
{
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
@@ -196,6 +310,18 @@ namespace FineUIPro.Web.common
|
||||
where y.ProjectState == Const.ProjectState_1
|
||||
select x;
|
||||
|
||||
if (pids!=null)
|
||||
{
|
||||
getD1 = from x in Funs.DB.Accident_AccidentHandle
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where pids.Contains(x.ProjectId)
|
||||
select x;
|
||||
getD2 = from x in Funs.DB.Accident_AccidentReport
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where pids.Contains(x.ProjectId)
|
||||
select x;
|
||||
}
|
||||
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
getD1 = getD1.Where(x => x.AccidentDate >= datetime1);
|
||||
@@ -542,10 +668,10 @@ namespace FineUIPro.Web.common
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected int Count3()
|
||||
protected int Count3(string[] pids)
|
||||
{
|
||||
int cout1 = 0;
|
||||
cout1 = Funs.DB.Solution_LargerHazard.Where(x => x.States == Const.State_2).Count();
|
||||
cout1 = Funs.DB.Solution_LargerHazard.Where(x => x.States == Const.State_2 && pids.Contains(x.ProjectId)).Count();
|
||||
return cout1;
|
||||
}
|
||||
#endregion
|
||||
@@ -561,20 +687,48 @@ namespace FineUIPro.Web.common
|
||||
protected string zgzglDataValue;
|
||||
protected void getZlwt()
|
||||
{
|
||||
zlallNumber = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now
|
||||
select x).Count().ToString();
|
||||
var num2 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && x.State == "7"
|
||||
select x).Count();
|
||||
zlfinishNumber = num2.ToString();
|
||||
var num3 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && x.State != "7"
|
||||
select x).Count();
|
||||
if (pids == null)
|
||||
{
|
||||
zlallNumber = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now
|
||||
select x).Count().ToString();
|
||||
|
||||
var zgl = String.Format("{0:N2}", 100.0 * num2 / (num2 + num3));
|
||||
zlzgl = zgl.ToString();
|
||||
zgzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
|
||||
var num2 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && x.State == "7"
|
||||
select x).Count();
|
||||
|
||||
zlfinishNumber = num2.ToString();
|
||||
var num3 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && x.State != "7"
|
||||
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();
|
||||
}
|
||||
else {
|
||||
zlallNumber = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && pids.Contains(x.ProjectId)
|
||||
select x).Count().ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && x.State == "7" && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
|
||||
zlfinishNumber = num2.ToString();
|
||||
var num3 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.CheckDate <= DateTime.Now && x.State != "7" && pids.Contains(x.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
|
||||
|
||||
@@ -586,19 +740,39 @@ namespace FineUIPro.Web.common
|
||||
protected string zggjzglDataValue;
|
||||
protected void getZlgj()
|
||||
{
|
||||
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
select x).Count();
|
||||
//Check_JointCheck
|
||||
zlgjallNumber = num1.ToString();
|
||||
if (pids == null)
|
||||
{
|
||||
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
select x).Count();
|
||||
//Check_JointCheck
|
||||
zlgjallNumber = num1.ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where x.IsOnceQualified == true
|
||||
select x).Count();
|
||||
zlgjfinishNumber = num2.ToString();
|
||||
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where x.IsOnceQualified == true
|
||||
select x).Count();
|
||||
zlgjfinishNumber = num2.ToString();
|
||||
|
||||
var zgl = String.Format("{0:N2}", 100.0 * num2 / num1);
|
||||
zlgjzgl = zgl.ToString();
|
||||
zggjzglDataValue = (100 - (100.0 * num2 / num1)).ToString();
|
||||
var zgl = String.Format("{0:N2}", 100.0 * num2 / num1);
|
||||
zlgjzgl = zgl.ToString();
|
||||
zggjzglDataValue = (100 - (100.0 * num2 / num1)).ToString();
|
||||
}
|
||||
else {
|
||||
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
//Check_JointCheck
|
||||
zlgjallNumber = num1.ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where x.IsOnceQualified == true && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
zlgjfinishNumber = num2.ToString();
|
||||
|
||||
var zgl = String.Format("{0:N2}", 100.0 * num2 / num1);
|
||||
zlgjzgl = zgl.ToString();
|
||||
zggjzglDataValue = (100 - (100.0 * num2 / num1)).ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -617,6 +791,10 @@ namespace FineUIPro.Web.common
|
||||
double result = 0;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var ndtLists = from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" select x;
|
||||
if (pids!=null)
|
||||
{
|
||||
ndtLists = from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && pids.Contains(x.ProjectId) select x;
|
||||
}
|
||||
decimal a = 0, b = 0;
|
||||
if (ndtLists.Count() > 0)
|
||||
{
|
||||
@@ -673,30 +851,61 @@ namespace FineUIPro.Web.common
|
||||
protected string gjsxZdl = "0";
|
||||
protected void getGjsx()
|
||||
{
|
||||
//Check_JointCheck
|
||||
var znum = (from x in Funs.DB.GJSX
|
||||
select x).Count();
|
||||
divGjsxzj.InnerHtml = znum.ToString();
|
||||
if (pids == null)
|
||||
{
|
||||
//Check_JointCheck
|
||||
var znum = (from x in Funs.DB.GJSX
|
||||
select x).Count();
|
||||
divGjsxzj.InnerHtml = znum.ToString();
|
||||
|
||||
//到期应完成
|
||||
var dqnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now
|
||||
select x).Count().ToString();
|
||||
divGjsxdq.InnerHtml = dqnum;
|
||||
//到期应完成
|
||||
var dqnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now
|
||||
select x).Count().ToString();
|
||||
divGjsxdq.InnerHtml = dqnum;
|
||||
|
||||
//未准点完成
|
||||
var wzdnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now
|
||||
&& x.State != "0"
|
||||
select x).Count().ToString();
|
||||
divGjsxwzd.InnerHtml = wzdnum;
|
||||
//未准点完成
|
||||
var wzdnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now
|
||||
&& x.State != "0"
|
||||
select x).Count().ToString();
|
||||
divGjsxwzd.InnerHtml = wzdnum;
|
||||
|
||||
//准点率,已完成/总数*100
|
||||
var ywcnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now
|
||||
&& x.State == "0"
|
||||
select x).Count();
|
||||
gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString();
|
||||
//准点率,已完成/总数*100
|
||||
var ywcnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now
|
||||
&& x.State == "0"
|
||||
select x).Count();
|
||||
gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString();
|
||||
}
|
||||
else {
|
||||
//Check_JointCheck
|
||||
var znum = (from x in Funs.DB.GJSX
|
||||
where pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
divGjsxzj.InnerHtml = znum.ToString();
|
||||
|
||||
//到期应完成
|
||||
var dqnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now && pids.Contains(x.ProjectId)
|
||||
select x).Count().ToString();
|
||||
divGjsxdq.InnerHtml = dqnum;
|
||||
|
||||
//未准点完成
|
||||
var wzdnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now
|
||||
&& x.State != "0" && pids.Contains(x.ProjectId)
|
||||
select x).Count().ToString();
|
||||
divGjsxwzd.InnerHtml = wzdnum;
|
||||
|
||||
//准点率,已完成/总数*100
|
||||
var ywcnum = (from x in Funs.DB.GJSX
|
||||
where x.CompleteDate <= DateTime.Now
|
||||
&& x.State == "0" && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -706,7 +915,14 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
int AllCount = 0;
|
||||
int MCount = 0;
|
||||
var getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now);
|
||||
var getallin = new List<Model.PageDataPersonInOutItem>();
|
||||
if (pids == null)
|
||||
{
|
||||
getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now);
|
||||
}
|
||||
else {
|
||||
getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now,pids);
|
||||
}
|
||||
AllCount = getallin.Count();
|
||||
if (AllCount > 0)
|
||||
{
|
||||
@@ -727,7 +943,16 @@ namespace FineUIPro.Web.common
|
||||
protected string ProjectPersonMc;
|
||||
private void getProjectSitePerson()
|
||||
{
|
||||
var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
|
||||
var list = new List<Model.Base_Project>();
|
||||
if (pids == null)
|
||||
{
|
||||
list= Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
|
||||
}
|
||||
else {
|
||||
list = Funs.DB.Base_Project.Where(x => pids.Contains(x.ProjectId)).ToList();
|
||||
}
|
||||
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
ProjectPersonMc += "'" + item.ShortName + "',";
|
||||
@@ -743,14 +968,25 @@ namespace FineUIPro.Web.common
|
||||
protected string ProjectMc;
|
||||
protected void getJd()
|
||||
{
|
||||
var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null) && x.Progress != null).ToList();
|
||||
foreach (var item in list)
|
||||
var list = new List<Model.Base_Project>();
|
||||
if (pids == null)
|
||||
{
|
||||
ProjectJd += "'" + item.Progress.Value.ToString("0.##") + "',";
|
||||
ProjectMc += "'" + item.ShortName + "',";
|
||||
list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null) && x.Progress != null).ToList();
|
||||
}
|
||||
ProjectJd = ProjectJd.TrimEnd(',');
|
||||
ProjectMc = ProjectMc.TrimEnd(',');
|
||||
else {
|
||||
list = Funs.DB.Base_Project.Where(x => pids.Contains(x.ProjectId) && x.Progress != null).ToList();
|
||||
}
|
||||
if (list.Count>0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
ProjectJd += "'" + item.Progress.Value.ToString("0.##") + "',";
|
||||
ProjectMc += "'" + item.ShortName + "',";
|
||||
}
|
||||
ProjectJd = ProjectJd.TrimEnd(',');
|
||||
ProjectMc = ProjectMc.TrimEnd(',');
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -767,22 +1003,42 @@ namespace FineUIPro.Web.common
|
||||
/// 获取隐患整改闭环项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetGeneralClosedNum()
|
||||
public int GetGeneralClosedNum()
|
||||
{
|
||||
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
int result = 0;
|
||||
if (pids==null)
|
||||
{
|
||||
result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.States == "3"
|
||||
select x).Count();
|
||||
}
|
||||
else {
|
||||
result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.States == "3" && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐患未整改完成项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetGeneralNotClosedNum()
|
||||
public int GetGeneralNotClosedNum()
|
||||
{
|
||||
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
int result = 0;
|
||||
if (pids == null)
|
||||
{
|
||||
result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.States != "3"
|
||||
select x).Count();
|
||||
}
|
||||
else {
|
||||
result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.States != "3" && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
@@ -797,7 +1053,15 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
|
||||
//项目
|
||||
var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
|
||||
var list = new List<Model.Base_Project>();
|
||||
if (pids == null)
|
||||
{
|
||||
list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null) && x.Progress != null).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
list = Funs.DB.Base_Project.Where(x => pids.Contains(x.ProjectId) && x.Progress != null).ToList();
|
||||
}
|
||||
var PipelinList = Funs.DB.CLGL_PipelineMaterialSumList.Where(x => x.Type == "M");
|
||||
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "设备");
|
||||
foreach (var item in list)
|
||||
@@ -920,13 +1184,25 @@ namespace FineUIPro.Web.common
|
||||
/// 获取未遂事件数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetNearMissNum()
|
||||
private int GetNearMissNum()
|
||||
{
|
||||
var result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
if (pids == null)
|
||||
{
|
||||
var result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
var result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
&& pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user