20250329 工作台
This commit is contained in:
@@ -109,6 +109,7 @@ namespace FineUIPro.Web.common
|
||||
var personTask = GetPersonAsync();
|
||||
var weekJdtjTask = GetWeekJDAsync();
|
||||
var monthJdtjTask = GetMonthJDAsync();
|
||||
var quantityDoneJDTask = GetQuantityDoneJDAsync();
|
||||
var otherTasks = new List<Task>
|
||||
{
|
||||
BindSafetyStatisticsAsync(), // 安全统计模块
|
||||
@@ -148,13 +149,14 @@ namespace FineUIPro.Web.common
|
||||
|
||||
getCNEN(),//中英文翻译
|
||||
};
|
||||
await Task.WhenAll(otherTasks.Concat(new[] { treeTask, personTask }));
|
||||
await Task.WhenAll(otherTasks.Concat(new[] { treeTask, personTask, weekJdtjTask, monthJdtjTask, quantityDoneJDTask }));
|
||||
|
||||
Tree = await treeTask;
|
||||
Person = await personTask;
|
||||
|
||||
WeekJdtjHtml = await weekJdtjTask;
|
||||
MonthJdtjHtml = await monthJdtjTask;
|
||||
QuantityDoneJdtjHtml = await quantityDoneJDTask;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,7 +477,7 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
var result = Project_HSSEData_HSSEService.GetFinishedNum(ProjectId);
|
||||
var result = Project_HSSEData_HSSEService.GetCompletedNum(ProjectId);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
@@ -553,7 +555,7 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
var result = Project_HSSEData_HSSEService.GetSuperFinishedNum(ProjectId);
|
||||
var result = Project_HSSEData_HSSEService.GetSuperCompletedNum(ProjectId);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
@@ -901,25 +903,62 @@ namespace FineUIPro.Web.common
|
||||
List<double> listdata = new List<double>();
|
||||
double result = 0;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
// var ndtList =
|
||||
// (from x in db.ProcessControl_NondestructiveTest_New
|
||||
// where x.ProfessionalName == "工艺管道" && x.ProjectId == ProjectId
|
||||
// orderby x.CreateDate descending
|
||||
// select x).FirstOrDefault();
|
||||
// decimal a = 0, b = 0;
|
||||
// if (ndtList != null)
|
||||
// {
|
||||
// if (ndtList.TotalQuantity.HasValue)
|
||||
// {
|
||||
// a += Math.Floor(ndtList.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndtList.TotalRate) /
|
||||
// 100);
|
||||
// b += ndtList.TotalQuantity.Value;
|
||||
// }
|
||||
//
|
||||
// if (!string.IsNullOrEmpty(ndtList.TotalRate))
|
||||
// {
|
||||
// result = Convert.ToDouble(ndtList.TotalRate);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var hjglData =
|
||||
// (from x in db.HJGL_FL_Data
|
||||
// where x.ProjectId == ProjectId
|
||||
// orderby x.CompileDate descending
|
||||
// select x).FirstOrDefault();
|
||||
// if (hjglData != null)
|
||||
// {
|
||||
// a = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmQualifiedAmount);
|
||||
// b = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmAmount);
|
||||
// if (a > 0 && b > 0)
|
||||
// {
|
||||
// result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
var ndtList =
|
||||
(from x in db.ProcessControl_NondestructiveTest_New
|
||||
where x.ProfessionalName == "工艺管道" && x.ProjectId == ProjectId
|
||||
orderby x.CreateDate descending
|
||||
select x).FirstOrDefault();
|
||||
where x.ProjectId == ProjectId
|
||||
select x).ToList();
|
||||
decimal a = 0, b = 0;
|
||||
if (ndtList != null)
|
||||
if (ndtList.Count > 0)
|
||||
{
|
||||
if (ndtList.TotalQuantity.HasValue)
|
||||
foreach (var item in ndtList)
|
||||
{
|
||||
a += Math.Floor(ndtList.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndtList.TotalRate) /
|
||||
100);
|
||||
b += ndtList.TotalQuantity.Value;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(ndtList.TotalRate))
|
||||
{
|
||||
result = Convert.ToDouble(ndtList.TotalRate);
|
||||
if (item.TotalQuantity.HasValue)
|
||||
{
|
||||
a += Math.Floor(item.TotalQuantity.Value * Funs.GetNewDecimalOrZero(item.TotalRate) /
|
||||
100);
|
||||
b += item.TotalQuantity.Value;
|
||||
}
|
||||
|
||||
}
|
||||
result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -938,7 +977,8 @@ namespace FineUIPro.Web.common
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (b > 0)
|
||||
{
|
||||
hjallNumber = b.ToString();
|
||||
@@ -1187,6 +1227,91 @@ namespace FineUIPro.Web.common
|
||||
|
||||
#endregion 赢得值曲线
|
||||
|
||||
|
||||
#region 工程量完成情况
|
||||
|
||||
protected string QuantityDoneJdtjHtml;
|
||||
protected string QuantityDoneJdtjHead = "<div class=\"th-p\" >类型</div><div class=\"th-p\" >设计数量</div><div class=\"th-p\"><p>本期</p><p><span>计划</span><span>实际</span><span>完成率</span></p></div><div class=\"th-p\"><p>累计</p><p><span>计划</span><span>实际</span><span>完成率</span></p></div><div class=\"th-p\" >完成率</div>";
|
||||
//protected string QuantityDoneJdtjHead = "<div class=\"th-p\" >类型</div><div class=\"th-p\" >单位</div><div class=\"th-p\" >设计数量</div><div class=\"th-p\"><p>本期</p><p><span>计划完成</span><span>实际完成</span><span>完成率</span></p></div><div class=\"th-p\"><p>累计</p><p><span>计划完成</span><span>实际完成</span><span>完成率</span></p></div><div class=\"th-p\" >完成率</div>";
|
||||
|
||||
/// <summary>
|
||||
/// 工程量完成情况
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task<string> GetQuantityDoneJDAsync()
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
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";
|
||||
|
||||
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);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int j = 0; j < tb.Rows.Count; j++)
|
||||
{
|
||||
string name = tb.Rows[j]["Name"].ToString().Trim();
|
||||
string unit = tb.Rows[j]["Unit"].ToString().Trim();
|
||||
string designNum = Funs.RemoveZero(tb.Rows[j]["DesignNum"].ToString().Trim());
|
||||
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 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();
|
||||
string sumRate = tb.Rows[j]["SumRate"].ToString().Trim();
|
||||
sb.Append("<div class=\"row\">");
|
||||
sb.Append($"<div class=\"tr\" >{name}({unit})</div>");
|
||||
//sb.Append($"<div class=\"tr\" >{unit}</div>");
|
||||
sb.Append($"<div class=\"tr\" >{designNum}</div>");
|
||||
sb.Append($"<div class=\"tr\" ><p><span>{planNum}</span><span>{realNum}</span><span>{rate}</span></p></div>");
|
||||
sb.Append($"<div class=\"tr\" ><p><span>{totalPlanNum}</span><span>{totalRealNum}</span><span>{totalRate}</span></p></div>");
|
||||
sb.Append($"<div class=\"tr\" >{sumRate}</div>");
|
||||
sb.Append("</div>");
|
||||
}
|
||||
doneJdtjHtml = sb.ToString();
|
||||
return doneJdtjHtml;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 进度统计
|
||||
|
||||
protected string WeekJdtjHtml;
|
||||
@@ -1206,10 +1331,8 @@ namespace FineUIPro.Web.common
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
string weekGridHtml = string.Empty;
|
||||
//获取当前时间所在周信息
|
||||
//获取当前时间上一个周计划信息
|
||||
var lastWeek = WeekPlanService.GetLastWeekPlan(this.CurrUser.LoginProjectId);
|
||||
////根据当前时间获取上一个周计划信息
|
||||
//var lastWeekItem = WeekItemService.GetWeekItemByDateNow(this.CurrUser.LoginProjectId);
|
||||
if (lastWeek != null)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
@@ -1534,7 +1657,7 @@ namespace FineUIPro.Web.common
|
||||
|
||||
SqlParameter[] Staticparameter = listStaticListStr.ToArray();
|
||||
DataTable statcitbDataTable = SQLHelper.GetDataTableRunProc("Sp_GJSXStatistic", Staticparameter);
|
||||
var list = from x in Funs.DB.GJSX where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
var list = from x in Funs.DB.GJSX where x.ProjectId == this.CurrUser.LoginProjectId && x.State!="1" select x;
|
||||
var allcount = list.Count(x => x.State == "0") + list.Count(x => x.State != "0" && x.CompleteDate < DateTime.Now);
|
||||
var closecount = list.Count(x => x.State == "0");
|
||||
gjsxRate = String.Format("{0:N2}", 100.0 * closecount / allcount);
|
||||
@@ -1624,7 +1747,7 @@ namespace FineUIPro.Web.common
|
||||
}
|
||||
|
||||
//设备材料
|
||||
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "设备" && x.ProjectId == pid);
|
||||
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "管道" && x.ProjectId == pid);
|
||||
foreach (var item in SbclList)
|
||||
{
|
||||
sbclHtml += "<div class=\"row\">";
|
||||
|
||||
Reference in New Issue
Block a user