河北专项检查和移动端
This commit is contained in:
@@ -3,13 +3,16 @@ using FineUIPro.Web.DataShow;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using NPOI.XWPF.UserModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Services;
|
||||
|
||||
namespace FineUIPro.Web.common
|
||||
{
|
||||
@@ -71,6 +74,82 @@ namespace FineUIPro.Web.common
|
||||
}
|
||||
}
|
||||
|
||||
protected void DatePicker1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region 获取项目劳务数据
|
||||
[WebMethod]
|
||||
public static Object GetServiceData(string ProjectId, string date)
|
||||
{
|
||||
DateTime mdate = Funs.GetNewDateTimeOrNow(date);
|
||||
int m_count = Funs.DB.Project_ProjectUser.Count(x => x.ProjectId == ProjectId);
|
||||
int job_count = (from x in Funs.DB.Meeting_ClassMeeting
|
||||
where x.ProjectId == ProjectId
|
||||
&& x.ClassMeetingDate.Value.Year == mdate.Year && x.ClassMeetingDate.Value.Month == mdate.Month && x.ClassMeetingDate.Value.Day == mdate.Day
|
||||
select new Model.MeetingItem
|
||||
{
|
||||
AttentPersonNum = x.AttentPersonNum ?? 0,
|
||||
|
||||
}).ToList().Sum(s => s.AttentPersonNum);
|
||||
|
||||
return new {
|
||||
m_count = m_count,
|
||||
job_count = job_count,
|
||||
all_count = job_count + m_count,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 按项目时间段获取安全问题统计
|
||||
[WebMethod]
|
||||
public static Object GetSafetyProblemStatistics(string ProjectId, string startdate, string enddate)
|
||||
{
|
||||
DateTime startd = Funs.GetNewDateTimeOrNow(string.Format("{0} {1}", startdate, "00:00:00"));
|
||||
DateTime endd = Funs.GetNewDateTimeOrNow(string.Format("{0} {1}", enddate, "23:59:59"));
|
||||
// 日常巡检总数
|
||||
List<Model.HSSE_Hazard_HazardRegister > HAllList = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == ProjectId&&x.ProblemTypes == "1"&& x.CheckTime > startd&& x.CheckTime < endd).ToList();
|
||||
int HAllCount = HAllList.Where(x=>x.States != "4").Count();
|
||||
int HDoneCount = HAllList.Where(x => x.States == "3").Count();
|
||||
int HUnDoneCount = HAllCount - HDoneCount;
|
||||
// 专项检查
|
||||
List<Model.Inspect_InspectionItem> SpecialList = (from x in Funs.DB.Inspect_InspectionItem
|
||||
join i in Funs.DB.Inspect_Inspection on x.InspectionId equals i.InspectionId
|
||||
where i.ProjectId == ProjectId && i.InspectType == "1" && x.CompileTime > startd && x.CompileTime < endd
|
||||
select new Model.Inspect_InspectionItem()).ToList();
|
||||
int SAllCount = SpecialList.Count();
|
||||
int SDoneCount = SpecialList.Where(x => x.States == "3").Count();
|
||||
int SUnDoneCount = SAllCount - SDoneCount;
|
||||
|
||||
// 检查列表
|
||||
var query =
|
||||
(from hsse in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where hsse.RectifyName != null && hsse.ProjectId == ProjectId && hsse.RegisterDate> startd && hsse.RegisterDate < endd
|
||||
group hsse by hsse.RectifyName into g1
|
||||
select new { type = g1.Key, count = g1.Count() }).Union((from i in Funs.DB.Inspect_Inspection
|
||||
join itm in Funs.DB.Inspect_InspectionItem on i.InspectionId equals itm.InspectionId
|
||||
where i.ProblemTypeName != null && i.ProjectId == ProjectId && i.CreateTime > startd && i.CreateTime < endd
|
||||
group i by i.ProblemTypeName into g2
|
||||
select new { type = g2.Key, count = g2.Count() })
|
||||
.Union(from ins in Funs.DB.Inspect_Inspection
|
||||
join itm in Funs.DB.Inspect_InspectionItem on ins.InspectionId equals itm.InspectionId
|
||||
where ins.Place != null && ins.ProjectId == ProjectId && ins.CreateTime > startd && ins.CreateTime < endd
|
||||
group ins by ins.Place into g3
|
||||
select new { type = g3.Key, count = g3.Count() })).ToList();
|
||||
|
||||
|
||||
return new
|
||||
{
|
||||
AllCount = HAllCount+ SAllCount,
|
||||
DoneCount = HDoneCount+ SDoneCount,
|
||||
UnDoneCount = HUnDoneCount+ SUnDoneCount,
|
||||
CheckList = query
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 待办事项
|
||||
protected string swiper_One
|
||||
{
|
||||
@@ -119,7 +198,6 @@ namespace FineUIPro.Web.common
|
||||
if (getMax.Count() > 0)
|
||||
{
|
||||
wHours = Convert.ToInt32(getMax.Sum(x => x.PersonWorkTime) ?? 0);
|
||||
this.divSafeWorkTime.InnerHtml = wHours.ToString("N0");
|
||||
}
|
||||
///整改单
|
||||
var getRectify = from x in Funs.DB.Check_RectifyNotices
|
||||
@@ -128,10 +206,8 @@ namespace FineUIPro.Web.common
|
||||
int allcout = getRectify.Count();
|
||||
if (allcout > 0)
|
||||
{
|
||||
this.divAllRectify.InnerHtml = allcout.ToString();
|
||||
|
||||
int ccount = getRectify.Where(x => x.States == Const.State_5).Count();
|
||||
this.divCRectify.InnerHtml = ccount.ToString();
|
||||
this.divUCRectify.InnerHtml = (allcout - ccount).ToString();
|
||||
}
|
||||
|
||||
var environment = Funs.DB.Environmental_EnvironmentalMonitoring.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.CompileDate).FirstOrDefault();
|
||||
@@ -197,7 +273,6 @@ namespace FineUIPro.Web.common
|
||||
if (AllCount > 0)
|
||||
{
|
||||
|
||||
this.divALLPerson.InnerHtml = AllCount.ToString();//所有的人
|
||||
HashSet<string> idCardNoSet = new HashSet<string>();
|
||||
foreach (string idCardNo in AllInOut)
|
||||
{
|
||||
@@ -210,20 +285,7 @@ namespace FineUIPro.Web.common
|
||||
MCount++;
|
||||
}
|
||||
}
|
||||
if (AllCount - MCount >= 0)
|
||||
{
|
||||
///管理人数
|
||||
this.divGLPerson.InnerHtml = MCount.ToString();//管理人员
|
||||
/////作业人数
|
||||
this.divZYPerson.InnerHtml = (AllCount - MCount).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
///管理人数
|
||||
this.divGLPerson.InnerHtml = MCount.ToString();
|
||||
/////作业人数
|
||||
this.divZYPerson.InnerHtml = "0";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user