五环大屏;进度管理;等

This commit is contained in:
2025-05-24 14:48:16 +08:00
parent 3e6008ee29
commit f135a948da
42 changed files with 1513 additions and 122 deletions
+31 -36
View File
@@ -263,12 +263,17 @@ namespace FineUIPro.Web.common
{
int AllCount = 0;
int MCount = 0;
var getallin = from x in Funs.DB.T_d_EmployInOutRecord
join z in Funs.DB.Base_WorkPost on x.PostId equals z.WorkPostId into zGroup
from z in zGroup.DefaultIfEmpty()
//where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == Convert.ToDateTime("2023-08-28")
select new { x.IDCardNo, z.PostType };
List<string> pids = new List<string>();
pids.Add(this.CurrUser.LoginProjectId);
var getallin = APIPageDataService.getPersonNum(pids, DateTime.Now);
//int AllCount = 0;
//int MCount = 0;
//var getallin = from x in Funs.DB.T_d_EmployInOutRecord
// join z in Funs.DB.Base_WorkPost on x.PostId equals z.WorkPostId into zGroup
// from z in zGroup.DefaultIfEmpty()
// where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
// select new { x.IDCardNo, z.PostType };
//var getallin = (from x in Funs.DB.SitePerson_Checking
// join z in Funs.DB.SitePerson_Person on x.PersonId equals z.PersonId into zGroup
@@ -1268,42 +1273,32 @@ namespace FineUIPro.Web.common
{
string doneJdtjHtml = string.Empty;
string month = string.Format("{0:yyyy-MM-01}", DateTime.Now);
//DateTime months = Convert.ToDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-01");
if (DateTime.Now.Day < 26)
{
month = string.Format("{0:yyyy-MM-01}", DateTime.Now.AddMonths(-1));
//months = Convert.ToDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.AddMonths(-1).Month.ToString() + "-01");
}
string strSql = @"select qc.QuantityCompletionId,(select PlanNum from JDGL_QuantityCompletion where QuantityListId=ql.QuantityListId and Months=@month) as PlanNum,
(select RealNum from JDGL_QuantityCompletion where QuantityListId=ql.QuantityListId and Months=@month) as RealNum,
(select NextNum from JDGL_QuantityCompletion where QuantityListId=ql.QuantityListId and Months=@month) as NextNum,ql.DesignNum,ql.Name,ql.Unit,ql.SortIndex,
CONVERT(FLOAT, (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) as TotalPlanNum,
CONVERT(FLOAT, (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) as TotalRealNum,
CONVERT(NVARCHAR(10), ((CAST(CASE ISNULL(qc.PlanNum, 0) WHEN 0 THEN 0
ELSE 100 * ISNULL(qc.RealNum, 0) / (1.0 * qc.PlanNum) END AS DECIMAL(9, 2))))) + '%'
AS Rate,
CONVERT(NVARCHAR(10), ((CAST(CASE(select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) WHEN 0 THEN 0
ELSE 100 * (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) / (1.0 * (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) END AS DECIMAL(9, 2)))))+'%'
AS TotalRate,
CONVERT(NVARCHAR(10), ((CAST(CASE ISNULL(ql.DesignNum, 0) WHEN 0 THEN 0
ELSE 100 * (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) / (1.0 * ql.DesignNum) END AS DECIMAL(9, 2)))))+'%'
AS SumRate,
CONVERT(FLOAT, (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months < qc.Months)) as LastTotalPlanNum,
CONVERT(FLOAT, (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months < qc.Months)) as LastTotalRealNum
from[dbo].JDGL_QuantityList ql
left join dbo.[JDGL_QuantityCompletion] qc on ql.QuantityListId=qc.QuantityListId
where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_QuantityCompletion] q where q.QuantityListId=qc.QuantityListId and q.Months<=@month order by q.Months desc) and qc.ProjectId=@ProjectId order by ql.SortIndex, ql.Name";
StringBuilder strSql = new StringBuilder();
strSql.AppendLine($@"select pro.ProjectId,pro.ProjectCode,pro.ProjectName,qc.QuantityCompletionId,ql.Name,ql.Unit,ql.DesignNum,ql.SortIndex,qco.PlanNum as PlanNum,qco.RealNum as RealNum,
CONVERT(NVARCHAR(10), ((CAST(CASE ISNULL(qco.PlanNum, 0) WHEN 0 THEN 0 ELSE 100 * ISNULL(qco.RealNum, 0) / (1.0 * qco.PlanNum) END AS DECIMAL(9, 2))))) AS Rate,
--(select NextNum from JDGL_QuantityCompletion where QuantityListId=ql.QuantityListId and Months=@month) as NextNum,
CONVERT(FLOAT, (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) as TotalPlanNum,
CONVERT(FLOAT, (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) as TotalRealNum,
CONVERT(NVARCHAR(10), ((CAST(CASE(select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) WHEN 0 THEN 0 ELSE 100 * (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) / (1.0 * (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) END AS DECIMAL(9, 2))))) AS TotalRate,
CONVERT(NVARCHAR(10), ((CAST(CASE ISNULL(ql.DesignNum, 0) WHEN 0 THEN 0 ELSE 100 * (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) / (1.0 * ql.DesignNum) END AS DECIMAL(9, 2))))) AS SumRate,
CONVERT(FLOAT, (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months < qc.Months)) as LastTotalPlanNum,
CONVERT(FLOAT, (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months < qc.Months)) as LastTotalRealNum ");
strSql.AppendLine(@"from JDGL_QuantityList ql
left join JDGL_QuantityCompletion qc on ql.QuantityListId=qc.QuantityListId
left join Base_Project pro on pro.ProjectId=qc.ProjectId
left join (select PlanNum,RealNum,QuantityListId from JDGL_QuantityCompletion where Months=@month) qco on qco.QuantityListId=ql.QuantityListId ");
strSql.AppendLine("where qc.ProjectId=@ProjectId and isnull(pro.ProjectState,1)=1 and qc.QuantityCompletionId=(select top 1 QuantityCompletionId from JDGL_QuantityCompletion q where q.QuantityListId=qc.QuantityListId and q.Months<=@month order by q.Months desc) ");
strSql.AppendLine("order by ql.SortIndex, ql.Name ");
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@month", month));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
DataTable tb = SQLHelper.GetDataTableRunText(strSql.ToString(), parameter);
StringBuilder sb = new StringBuilder();
for (int j = 0; j < tb.Rows.Count; j++)
@@ -1314,7 +1309,7 @@ where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_Quant
string planNum = Funs.RemoveZero(tb.Rows[j]["PlanNum"].ToString().Trim());
string realNum = Funs.RemoveZero(tb.Rows[j]["RealNum"].ToString().Trim());
string rate = tb.Rows[j]["Rate"].ToString().Trim();
string nextNum = Funs.RemoveZero(tb.Rows[j]["NextNum"].ToString().Trim());
//string nextNum = Funs.RemoveZero(tb.Rows[j]["NextNum"].ToString().Trim());
string totalPlanNum = Funs.RemoveZero(tb.Rows[j]["TotalPlanNum"].ToString().Trim());
string totalRealNum = Funs.RemoveZero(tb.Rows[j]["TotalRealNum"].ToString().Trim());
string totalRate = tb.Rows[j]["TotalRate"].ToString().Trim();
@@ -1505,8 +1500,8 @@ where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_Quant
listdata.Add(workPostCount2);
//焊工
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);
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 || x.WorkPostId == Const.WorkPost_Welder6);
listdata.Add(workPostCount6);
//铆工
listCategories.Add("铆工");
+2 -2
View File
@@ -530,9 +530,9 @@
window.open("../DataShow/GJSX.aspx")
}else if (type == 'JD') {
// $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //关键事项数据
// $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //进度管理数据
window.open("../DataShow/JD.aspx")
window.open("../DataShow/JDStatistics.aspx")
}
else if (type == 'ManagerData') {
// $('iframe').attr('src', '../InterfacePopup/CQMS/ManagerData.aspx') //管理人员数据
+32 -17
View File
@@ -127,23 +127,38 @@ namespace FineUIPro.Web.common
{
this.divSafeWorkTimeMonth.InnerHtml = countMonthAqrgs.ToString().Split('.')[0];
}
// 安全培训人员(合并数据库查询)
var trainingQuery = db.EduTrain_TrainRecord
.Where(x => pids.Contains(x.ProjectId))
.GroupBy(x => 1)
.Select(g => new
{
TrainCount = g.Sum(x => x.TrainPersonNum) ?? 0,
BoShengCount = db.Bo_Sheng_TrainPerson
.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null))
.Where(x => pids.Contains(x.ProjectId))
.Count()
}).FirstOrDefault();
//// 安全培训人员(合并数据库查询)
//var trainingQuery = db.EduTrain_TrainRecord
// .Where(x => pids.Contains(x.ProjectId))
// .GroupBy(x => 1)
// .Select(g => new
// {
// TrainCount = g.Sum(x => x.TrainPersonNum) ?? 0,
// BoShengCount = db.Bo_Sheng_TrainPerson
// .Where(x => (x.DeleteTag == "False" || x.DeleteTag == null))
// .Where(x => pids.Contains(x.ProjectId))
// .Count()
// }).FirstOrDefault();
//divSafePersonNum.InnerHtml = trainingQuery != null
// ? (trainingQuery.TrainCount + trainingQuery.BoShengCount).ToString()
// : "0";
int getTrainRecord = 0, boShengCount = 0;
if (pids == null)
{
getTrainRecord = db.View_EduTrain_TrainFind.Count();
//修改:增加博晟教育中的人数
boShengCount = db.Bo_Sheng_TrainPerson.Count(x => x.DeleteTag == "False" || x.DeleteTag == null);
}
else
{
getTrainRecord = db.View_EduTrain_TrainFind.Where(x => pids.Contains(x.ProjectId)).Count();
//修改:增加博晟教育中的人数
boShengCount = db.Bo_Sheng_TrainPerson.Count(x => pids.Contains(x.ProjectId) && (x.DeleteTag == "False" || x.DeleteTag == null));
}
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
divSafePersonNum.InnerHtml = trainingQuery != null
? (trainingQuery.TrainCount + trainingQuery.BoShengCount).ToString()
: "0";
@@ -1237,11 +1252,11 @@ namespace FineUIPro.Web.common
{
var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
where y.AccidentTypeName.Contains("未遂")
where y.AccidentTypeName.Contains("未遂")
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("未遂")
where y.ConstText.Contains("未遂")
select x;
result = wsAccidentList1.Count() + wsAccidentList2.Count();
//result = (from x in Funs.DB.Accident_AccidentPersonRecord