专项检查

This commit is contained in:
2025-04-15 20:48:53 +08:00
parent 80ea8ec450
commit 1c6dca4612
36 changed files with 29955 additions and 932 deletions
+86 -79
View File
@@ -12,6 +12,7 @@ using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Web.Services;
namespace FineUIPro.Web.common
@@ -50,7 +51,7 @@ namespace FineUIPro.Web.common
this.ProjectId = this.CurrUser.LoginProjectId;
}
/// 获取安全人工时
getPersonWorkTime();
//getPersonWorkTime();
///劳务统计
getSitePerson();
///项目概况
@@ -81,13 +82,14 @@ namespace FineUIPro.Web.common
#region
[WebMethod]
public static Object GetServiceData(string ProjectId, string date)
public static Object GetServiceData(string ProjectId, string startdate, string enddate)
{
DateTime mdate = Funs.GetNewDateTimeOrNow(date);
DateTime startd = Funs.GetNewDateTimeOrNow(string.Format("{0} {1}", startdate, "00:00:00"));
DateTime endd = Funs.GetNewDateTimeOrNow(string.Format("{0} {1}", enddate, "23:59:59"));
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
where x.ProjectId == ProjectId && x.ClassMeetingDate >= startd && x.ClassMeetingDate <= endd
select new Model.MeetingItem
{
AttentPersonNum = x.AttentPersonNum ?? 0,
@@ -130,12 +132,12 @@ namespace FineUIPro.Web.common
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
where i.ProblemTypeName != null && i.ProjectId == ProjectId && i.CreateTime > startd && i.CreateTime < endd && i.InspectType == "1"
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
where ins.Place != null && ins.ProjectId == ProjectId && ins.CreateTime > startd && ins.CreateTime < endd && ins.InspectType == "1"
group ins by ins.Place into g3
select new { type = g3.Key, count = g3.Count() })).ToList();
@@ -173,7 +175,6 @@ namespace FineUIPro.Web.common
/// </summary>
private void getPersonWorkTime()
{
//this.divSafeWorkTime.InnerHtml = "0000000000";
var monthReportB = from y in Funs.DB.Manager_MonthReportB
where y.ProjectId == this.CurrUser.LoginProjectId
orderby y.Months descending
@@ -245,90 +246,96 @@ namespace FineUIPro.Web.common
/// </summary>
private void getSitePerson()
{
int AllCount = 0;
int MCount = 0;
//var getallin = APIPageDataService.getPersonInOutNum(this.ProjectId, DateTime.Now.AddDays(-1));
DateTime dateValue = DateTime.Now.AddDays(-1);
List<Model.PageDataPersonInOutItem> getallin = new List<Model.PageDataPersonInOutItem>();
var getInMaxs = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsUsed == true
select new Model.PageDataPersonInOutItem
{
PersonId = x.PersonId,
PostType = y.PostType,
WorkPostId = x.WorkPostId,
IdentityCard = x.IdentityCard
};
if (getInMaxs.Count() > 0)
{
getallin = getInMaxs.Distinct().ToList();
}
var AllInOut = (from x in Funs.DB.T_d_EmployInOutRecord
join y in Funs.DB.SitePerson_Person on new { ss1 = x.ProjectId, ss = x.IDCardNo } equals new { ss1 = y.ProjectId, ss = y.IdentityCard }
where y.ProjectId == this.CurrUser.LoginProjectId && y.IsUsed == true && x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
select x.IDCardNo).Distinct();
AllCount = AllInOut.Count();
if (AllCount > 0)
try
{
int AllCount = 0;
int MCount = 0;
//var getallin = APIPageDataService.getPersonInOutNum(this.ProjectId, DateTime.Now.AddDays(-1));
DateTime dateValue = DateTime.Now.AddDays(-1);
List<Model.PageDataPersonInOutItem> getallin = new List<Model.PageDataPersonInOutItem>();
var getInMaxs = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsUsed == true
select new Model.PageDataPersonInOutItem
{
PersonId = x.PersonId,
PostType = y.PostType,
WorkPostId = x.WorkPostId,
IdentityCard = x.IdentityCard
HashSet<string> idCardNoSet = new HashSet<string>();
foreach (string idCardNo in AllInOut)
};
if (getInMaxs.Count() > 0)
{
idCardNoSet.Add(idCardNo);
getallin = getInMaxs.Distinct().ToList();
}
foreach (var i in getallin)
var AllInOut = (from x in Funs.DB.T_d_EmployInOutRecord
join y in Funs.DB.SitePerson_Person on new { ss1 = x.ProjectId, ss = x.IDCardNo } equals new { ss1 = y.ProjectId, ss = y.IdentityCard }
where y.ProjectId == this.CurrUser.LoginProjectId && y.IsUsed == true && x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
select x.IDCardNo).Distinct();
AllCount = AllInOut.Count();
if (AllCount > 0)
{
if (i.PostType == Const.PostType_1 && idCardNoSet.Contains(i.IdentityCard))
HashSet<string> idCardNoSet = new HashSet<string>();
foreach (string idCardNo in AllInOut)
{
MCount++;
idCardNoSet.Add(idCardNo);
}
}
}
WorkPostS = "[]";
InPostCounts = "[]";
InDutyCounts = "[]";
List<int> InPostCountList = new List<int>();
List<int> InDutyCountList = new List<int>();
List<string> worksList = new List<string>();
//if (this.CurrUser.UserId != Const.hfnbdId)
//{
var getPersons = Funs.DB.SitePerson_Person.Where(x => x.ProjectId == this.ProjectId && x.IsUsed == true && x.InTime <= DateTime.Now
&& !x.OutTime.HasValue);
if (getPersons.Count() > 0)
{
var getWorkIds = getPersons.Where(x => x.WorkPostId != null).Select(x => x.WorkPostId).Distinct();
if (getWorkIds.Count() > 0)
{
foreach (var item in getWorkIds)
foreach (var i in getallin)
{
worksList.Add(WorkPostService.getWorkPostNameById(item));
int isPost = getPersons.Where(x => x.WorkPostId == item).Count();
InPostCountList.Add(isPost);
int inDuty = 0;
if (getallin.Count() > 0)
if (i.PostType == Const.PostType_1 && idCardNoSet.Contains(i.IdentityCard))
{
inDuty = getallin.Where(x => x.WorkPostId == item).Count();
MCount++;
}
}
}
WorkPostS = "[]";
InPostCounts = "[]";
InDutyCounts = "[]";
List<int> InPostCountList = new List<int>();
List<int> InDutyCountList = new List<int>();
List<string> worksList = new List<string>();
//if (this.CurrUser.UserId != Const.hfnbdId)
//{
var getPersons = Funs.DB.SitePerson_Person.Where(x => x.ProjectId == this.ProjectId && x.IsUsed == true && x.InTime <= DateTime.Now
&& !x.OutTime.HasValue);
if (getPersons.Count() > 0)
{
var getWorkIds = getPersons.Where(x => x.WorkPostId != null).Select(x => x.WorkPostId).Distinct();
if (getWorkIds.Count() > 0)
{
foreach (var item in getWorkIds)
{
worksList.Add(WorkPostService.getWorkPostNameById(item));
int isPost = getPersons.Where(x => x.WorkPostId == item).Count();
InPostCountList.Add(isPost);
int inDuty = 0;
if (getallin.Count() > 0)
{
inDuty = getallin.Where(x => x.WorkPostId == item).Count();
}
InDutyCountList.Add(inDuty);
}
InDutyCountList.Add(inDuty);
}
}
}
else
{
worksList.Add(" ");
InPostCountList.Add(0);
InDutyCountList.Add(0);
}
//}
else
{
worksList.Add(" ");
InPostCountList.Add(0);
InDutyCountList.Add(0);
}
//}
WorkPostS = JsonConvert.SerializeObject(worksList);
InPostCounts = JsonConvert.SerializeObject(InPostCountList);
InDutyCounts = JsonConvert.SerializeObject(InDutyCountList);
WorkPostS = JsonConvert.SerializeObject(worksList);
InPostCounts = JsonConvert.SerializeObject(InPostCountList);
InDutyCounts = JsonConvert.SerializeObject(InDutyCountList);
} catch (Exception ex)
{
}
}
#endregion