提交代码

This commit is contained in:
高飞 2024-04-10 15:43:48 +08:00
parent 7cdbe93dca
commit eb17a1e45f
1 changed files with 102 additions and 88 deletions

View File

@ -44,14 +44,14 @@ namespace FineUIPro.Web.common
DateTime d1 = getStartMonth(); DateTime d1 = getStartMonth();
DateTime d2 = getEndMonth(); DateTime d2 = getEndMonth();
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))) //int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day)))
// .Max(x => x.WorkHours) ?? 0; // .Max(x => x.WorkHours) ?? 0;
//this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString(); //this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
//安全培训累计人员 //安全培训累计人员
var getTrainRecord = db.EduTrain_TrainRecord.Sum(x=>x.TrainPersonNum)??0; 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; var boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)).ToList().Count;
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString(); this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
@ -68,15 +68,20 @@ namespace FineUIPro.Web.common
//质量管理人员 //质量管理人员
int CqmsManageNum = (from x in Funs.DB.Person_CompanyBranchPerson int CqmsManageNum = (from x in Funs.DB.Person_CompanyBranchPerson
where x.IsOnJob == true join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
select x).Count(); 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(); this.divCqmsManageNum.InnerText = CqmsManageNum.ToString();
//质量培训人员 //质量培训人员
DateTime date = DateTime.Now.AddDays(-1); DateTime date = DateTime.Now.AddDays(-1);
int CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson int CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson
where x.IsTrain == true where x.IsTrain == true
select x).Count(); select x).Count();
divCqmsPxNum.InnerText = CqmsPxNum.ToString(); divCqmsPxNum.InnerText = CqmsPxNum.ToString();
//质量问题 //质量问题
@ -97,10 +102,10 @@ namespace FineUIPro.Web.common
int pcount1 = 0; int pcount1 = 0;
int pcount2 = 0; int pcount2 = 0;
int pcount3 = 0; int pcount3 = 0;
if (acount>0) if (acount > 0)
{ {
pcount1= allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Count(); 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(); pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true select x).Count();
pcount3 = Count3(); pcount3 = Count3();
} }
div_zjxmCount.InnerText = pcount1.ToString(); div_zjxmCount.InnerText = pcount1.ToString();
@ -159,57 +164,57 @@ namespace FineUIPro.Web.common
protected decimal CountAqrgs(DateTime? d1 = null, DateTime? d2 = null) protected decimal CountAqrgs(DateTime? d1 = null, DateTime? d2 = null)
{ {
decimal cout1 = 0; decimal cout1 = 0;
var datetime1 = d1;
var datetime2 = d2;
var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
select x;
if (getAllPersonInOutList.Count() > 0)
{
if (datetime1.HasValue)
{
getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate >= datetime1);
}
if (datetime2.HasValue)
{
getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate <= datetime2);
}
if (getAllPersonInOutList.Count() > 0)
{
cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours);
}
}
var getD1 = from x in Funs.DB.Accident_AccidentHandle var datetime1 = d1;
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId var datetime2 = d2;
where y.ProjectState == Const.ProjectState_1 var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
select x;
var getD2 = from x in Funs.DB.Accident_AccidentReport
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where y.ProjectState == Const.ProjectState_1
select x;
select x;
if (getAllPersonInOutList.Count() > 0)
{
if (datetime1.HasValue) if (datetime1.HasValue)
{ {
getD1 = getD1.Where(x => x.AccidentDate >= datetime1); getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate >= datetime1);
getD2 = getD2.Where(x => x.CompileDate >= datetime1);
} }
if (datetime2.HasValue) if (datetime2.HasValue)
{ {
getD1 = getD1.Where(x => x.AccidentDate <= datetime2); getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate <= datetime2);
getD2 = getD2.Where(x => x.CompileDate <= datetime2);
} }
if (getAllPersonInOutList.Count() > 0)
{
cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours);
}
}
var getD1 = from x in Funs.DB.Accident_AccidentHandle
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where y.ProjectState == Const.ProjectState_1
select x;
var getD2 = from x in Funs.DB.Accident_AccidentReport
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where y.ProjectState == Const.ProjectState_1
select x;
if (datetime1.HasValue)
{
getD1 = getD1.Where(x => x.AccidentDate >= datetime1);
getD2 = getD2.Where(x => x.CompileDate >= datetime1);
}
if (datetime2.HasValue)
{
getD1 = getD1.Where(x => x.AccidentDate <= datetime2);
getD2 = getD2.Where(x => x.CompileDate <= datetime2);
}
if (getD1.Count() > 0) if (getD1.Count() > 0)
{ {
cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0); cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0);
} }
if (getD2.Count() > 0) if (getD2.Count() > 0)
{ {
cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0); cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0);
} }
return cout1; return cout1;
} }
@ -222,7 +227,7 @@ namespace FineUIPro.Web.common
Model.SGGLDB db = Funs.DB; Model.SGGLDB db = Funs.DB;
List<Model.SitePerson_MonthReport> reports = new List<Model.SitePerson_MonthReport>(); List<Model.SitePerson_MonthReport> reports = new List<Model.SitePerson_MonthReport>();
var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber
select x; select x;
if (getAllPersonInOutList.Count() > 0) if (getAllPersonInOutList.Count() > 0)
{ {
@ -240,7 +245,7 @@ namespace FineUIPro.Web.common
Model.SitePerson_MonthReport reportItem = new Model.SitePerson_MonthReport Model.SitePerson_MonthReport reportItem = new Model.SitePerson_MonthReport
{ {
MonthReportId = SQLHelper.GetNewID(), MonthReportId = SQLHelper.GetNewID(),
CompileDate = Funs.GetNewDateTime(item.Year.ToString() + "-" + item.Month.ToString()), CompileDate = Funs.GetNewDateTime(item.Year.ToString() + "-" + item.Month.ToString()),
TotalPersonWorkTime = getNow, TotalPersonWorkTime = getNow,
}; };
@ -439,19 +444,20 @@ namespace FineUIPro.Web.common
//修改日期 2023-10-30 10:43:57 //修改日期 2023-10-30 10:43:57
//内容:项目名称、开工日期、完工日期、剩余天数、进度 //内容:项目名称、开工日期、完工日期、剩余天数、进度
mapStr += item.ProjectId+","; mapStr += item.ProjectId + ",";
mapStr += string.Format("{0:yyyy-MM-dd}", item.StartDate) + ","; mapStr += string.Format("{0:yyyy-MM-dd}", item.StartDate) + ",";
if (string.IsNullOrEmpty(item.EndDate.ToString())) if (string.IsNullOrEmpty(item.EndDate.ToString()))
{ {
mapStr += ","; mapStr += ",";
} }
else { else
{
//获取剩余天数 //获取剩余天数
var residueDay = DateDiff(DateTime.Now, Convert.ToDateTime(item.EndDate)).ToString(); var residueDay = DateDiff(DateTime.Now, Convert.ToDateTime(item.EndDate)).ToString();
mapStr += string.Format("{0:yyyy-MM-dd}", item.EndDate) + ","+residueDay; mapStr += string.Format("{0:yyyy-MM-dd}", item.EndDate) + "," + residueDay;
} }
@ -508,7 +514,8 @@ namespace FineUIPro.Web.common
protected string zlzgl; protected string zlzgl;
protected string zgzglDataValue; protected string zgzglDataValue;
protected void getZlwt() { protected void getZlwt()
{
zlallNumber = (from x in Funs.DB.Check_CheckControl zlallNumber = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now where x.CheckDate <= DateTime.Now
select x).Count().ToString(); select x).Count().ToString();
@ -517,8 +524,8 @@ namespace FineUIPro.Web.common
select x).Count(); select x).Count();
zlfinishNumber = num2.ToString(); zlfinishNumber = num2.ToString();
var num3 = (from x in Funs.DB.Check_CheckControl var num3 = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && x.State != "7" where x.CheckDate <= DateTime.Now && x.State != "7"
select x).Count(); select x).Count();
var zgl = String.Format("{0:N2}", 100.0 * num2 / (num2 + num3)); var zgl = String.Format("{0:N2}", 100.0 * num2 / (num2 + num3));
zlzgl = zgl.ToString(); zlzgl = zgl.ToString();
@ -532,11 +539,12 @@ namespace FineUIPro.Web.common
protected string zlgjzgl; protected string zlgjzgl;
protected string zggjzglDataValue; protected string zggjzglDataValue;
protected void getZlgj() { protected void getZlgj()
{
//Check_JointCheck //Check_JointCheck
zlgjallNumber = (from x in Funs.DB.Check_JointCheck zlgjallNumber = (from x in Funs.DB.Check_JointCheck
where x.CheckDate <= DateTime.Now where x.CheckDate <= DateTime.Now
select x).Count().ToString(); select x).Count().ToString();
var num2 = (from x in Funs.DB.Check_JointCheck var num2 = (from x in Funs.DB.Check_JointCheck
where x.CheckDate <= DateTime.Now && x.State == BLL.Const.JointCheck_Complete where x.CheckDate <= DateTime.Now && x.State == BLL.Const.JointCheck_Complete
@ -555,11 +563,11 @@ namespace FineUIPro.Web.common
#endregion #endregion
#region #region
protected string hjallNumber="0"; protected string hjallNumber = "0";
protected string hjfinishNumber="0"; protected string hjfinishNumber = "0";
protected string hjzgl="0"; protected string hjzgl = "0";
protected string hjDataValue="0"; protected string hjDataValue = "0";
protected void getHj() protected void getHj()
{ {
Model.SingleSerie series = new Model.SingleSerie(); Model.SingleSerie series = new Model.SingleSerie();
@ -601,7 +609,7 @@ namespace FineUIPro.Web.common
} }
} }
} }
#endregion #endregion
@ -613,27 +621,28 @@ namespace FineUIPro.Web.common
{ {
//Check_JointCheck //Check_JointCheck
var znum = (from x in Funs.DB.GJSX var znum = (from x in Funs.DB.GJSX
select x).Count(); select x).Count();
divGjsxzj.InnerHtml = znum.ToString(); divGjsxzj.InnerHtml = znum.ToString();
//到期应完成 //到期应完成
var dqnum = (from x in Funs.DB.GJSX where x.CompleteDate<=DateTime.Now var dqnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now
select x).Count().ToString(); select x).Count().ToString();
divGjsxdq.InnerHtml = dqnum; divGjsxdq.InnerHtml = dqnum;
//未准点完成 //未准点完成
var wzdnum = (from x in Funs.DB.GJSX var wzdnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now where x.CompleteDate <= DateTime.Now
&& x.State !="0" && x.State != "0"
select x).Count().ToString(); select x).Count().ToString();
divGjsxwzd.InnerHtml = wzdnum; divGjsxwzd.InnerHtml = wzdnum;
//准点率,已完成/总数*100 //准点率,已完成/总数*100
var ywcnum = (from x in Funs.DB.GJSX var ywcnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now where x.CompleteDate <= DateTime.Now
&& x.State == "0" && x.State == "0"
select x).Count(); select x).Count();
gjsxZdl = Math.Round((100.0 * ywcnum / znum),2).ToString(); gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString();
} }
#endregion #endregion
@ -671,7 +680,7 @@ namespace FineUIPro.Web.common
foreach (var item in list) foreach (var item in list)
{ {
ProjectPersonMc += "'" + item.ShortName + "',"; ProjectPersonMc += "'" + item.ShortName + "',";
ProjectPersonCount += "'" + APIPageDataService.getPersonNum(item.ProjectId,DateTime.Now).Count() + "',"; ProjectPersonCount += "'" + APIPageDataService.getPersonNum(item.ProjectId, DateTime.Now).Count() + "',";
} }
ProjectPersonMc = ProjectPersonMc.TrimEnd(','); ProjectPersonMc = ProjectPersonMc.TrimEnd(',');
ProjectPersonCount = ProjectPersonCount.TrimEnd(','); ProjectPersonCount = ProjectPersonCount.TrimEnd(',');
@ -681,7 +690,8 @@ namespace FineUIPro.Web.common
#region #region
protected string ProjectJd; protected string ProjectJd;
protected string ProjectMc; protected string ProjectMc;
protected void getJd() { protected void getJd()
{
var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null) && x.Progress != null).ToList(); 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) foreach (var item in list)
{ {
@ -694,11 +704,12 @@ namespace FineUIPro.Web.common
#endregion #endregion
#region #region
protected void getZgsj() { protected void getZgsj()
{
div_zgsj.InnerHtml = (GetGeneralClosedNum() + GetGeneralNotClosedNum()).ToString(); div_zgsj.InnerHtml = (GetGeneralClosedNum() + GetGeneralNotClosedNum()).ToString();
div_zgywc.InnerHtml = GetGeneralClosedNum().ToString(); div_zgywc.InnerHtml = GetGeneralClosedNum().ToString();
div_zgwwc.InnerHtml = GetGeneralNotClosedNum().ToString(); div_zgwwc.InnerHtml = GetGeneralNotClosedNum().ToString();
div_zgwcl.InnerHtml= String.Format("{0:N2}", 100.0 * GetGeneralClosedNum() / (GetGeneralNotClosedNum() + GetGeneralClosedNum()))+"%"; div_zgwcl.InnerHtml = String.Format("{0:N2}", 100.0 * GetGeneralClosedNum() / (GetGeneralNotClosedNum() + GetGeneralClosedNum())) + "%";
} }
/// <summary> /// <summary>
@ -731,8 +742,9 @@ namespace FineUIPro.Web.common
protected string gdclHead = "<span>项目</span><span>管子</span><span>管件</span><span>阀门</span><span>垫片</span><span>紧固件</span>"; protected string gdclHead = "<span>项目</span><span>管子</span><span>管件</span><span>阀门</span><span>垫片</span><span>紧固件</span>";
protected string sbclHead = "<span>项目</span><span>采购量</span><span>到货量</span><span>已到货百分比</span>"; protected string sbclHead = "<span>项目</span><span>采购量</span><span>到货量</span><span>已到货百分比</span>";
private void getCldh() { private void getCldh()
{
//项目 //项目
var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList(); var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
var PipelinList = Funs.DB.CLGL_PipelineMaterialSumList.Where(x => x.Type == "M"); var PipelinList = Funs.DB.CLGL_PipelineMaterialSumList.Where(x => x.Type == "M");
@ -801,7 +813,7 @@ namespace FineUIPro.Web.common
#region #region
sbclHtml += " <div class=\"tr\">"; sbclHtml += " <div class=\"tr\">";
pname=item.ShortName; pname = item.ShortName;
if (item.ShortName.Length > 5) if (item.ShortName.Length > 5)
{ {
pname = item.ShortName.Substring(0, 5) + "..."; pname = item.ShortName.Substring(0, 5) + "...";
@ -818,8 +830,9 @@ namespace FineUIPro.Web.common
SbcllCgl += 0; SbcllCgl += 0;
Sbdhs += 0; Sbdhs += 0;
} }
else { else
SbcllCgl +=Convert.ToDouble(itemCgl.C7); {
SbcllCgl += Convert.ToDouble(itemCgl.C7);
Sbdhs += Convert.ToDouble(itemCgl.C9); Sbdhs += Convert.ToDouble(itemCgl.C9);
} }
} }
@ -832,12 +845,13 @@ namespace FineUIPro.Web.common
var dhbfb = String.Format("{0:N2}", 100.0 * Sbdhs / (Sbdhs + SbcllCgl), 2) + "%"; var dhbfb = String.Format("{0:N2}", 100.0 * Sbdhs / (Sbdhs + SbcllCgl), 2) + "%";
sbclHtml += "<span>" + dhbfb + "</span>"; sbclHtml += "<span>" + dhbfb + "</span>";
} }
else { else
{
sbclHtml += "<span>0%</span>"; sbclHtml += "<span>0%</span>";
} }
sbclHtml += " </div>"; sbclHtml += " </div>";
#endregion #endregion