进度管理:工程量完成情况
This commit is contained in:
parent
7724d823a7
commit
0d01ba5cbc
|
@ -1250,6 +1250,59 @@ namespace BLL
|
|||
//return TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddSeconds(timestamp);
|
||||
}
|
||||
|
||||
#region 去除后面多余的零
|
||||
|
||||
/// <summary>
|
||||
/// 去除后面多余的零
|
||||
/// </summary>
|
||||
/// <param name="sResult"></param>
|
||||
/// <returns></returns>
|
||||
public static string RemoveZero(string sResult)
|
||||
{
|
||||
if (sResult.IndexOf(".") < 0)
|
||||
return sResult;
|
||||
int iIndex = sResult.Length - 1;
|
||||
for (int i = sResult.Length - 1; i >= 0; i--)
|
||||
{
|
||||
if (sResult.Substring(i, 1) != "0")
|
||||
{
|
||||
iIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sResult = sResult.Substring(0, iIndex + 1);
|
||||
if (sResult.EndsWith("."))
|
||||
sResult = sResult.Substring(0, sResult.Length - 1);
|
||||
return sResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 去除后面多余的零
|
||||
/// </summary>
|
||||
/// <param name="dValue"></param>
|
||||
/// <returns></returns>
|
||||
public static string RemoveZero(decimal dValue)
|
||||
{
|
||||
string sResult = dValue.ToString();
|
||||
if (sResult.IndexOf(".") < 0)
|
||||
return sResult;
|
||||
int iIndex = sResult.Length - 1;
|
||||
for (int i = sResult.Length - 1; i >= 0; i--)
|
||||
{
|
||||
if (sResult.Substring(i, 1) != "0")
|
||||
{
|
||||
iIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sResult = sResult.Substring(0, iIndex + 1);
|
||||
if (sResult.EndsWith("."))
|
||||
sResult = sResult.Substring(0, sResult.Length - 1);
|
||||
return sResult;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static string RequestGet(string Baseurl, string Token)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
|
|
|
@ -1352,4 +1352,8 @@
|
|||
<value>Completion status of weekly plan</value>
|
||||
<comment>周计划完成情况</comment>
|
||||
</data>
|
||||
<data name="mainProject2_QuantityDone" xml:space="preserve">
|
||||
<value>Completion status of engineering quantity</value>
|
||||
<comment>工程量完成情况</comment>
|
||||
</data>
|
||||
</root>
|
|
@ -1197,4 +1197,7 @@
|
|||
<data name="mainProject2_WeekPlanDone" xml:space="preserve">
|
||||
<value>周计划完成情况</value>
|
||||
</data>
|
||||
<data name="mainProject2_QuantityDone" xml:space="preserve">
|
||||
<value>工程量完成情况</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1194,4 +1194,7 @@
|
|||
<data name="mainProject2_WeekPlanDone" xml:space="preserve">
|
||||
<value>周计划完成情况</value>
|
||||
</data>
|
||||
<data name="mainProject2_QuantityDone" xml:space="preserve">
|
||||
<value>工程量完成情况</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1185,6 +1185,15 @@ namespace Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 工程量完成情况 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string mainProject2_QuantityDone {
|
||||
get {
|
||||
return ResourceManager.GetString("mainProject2_QuantityDone", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 质量安全预警 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -3067,7 +3076,7 @@ namespace Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 欢迎回来 的本地化字符串。
|
||||
/// 查找类似 欢迎回来 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string String1 {
|
||||
get {
|
||||
|
@ -3076,7 +3085,7 @@ namespace Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 分包管理 的本地化字符串。
|
||||
/// 查找类似 分包管理 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string SubManagement {
|
||||
get {
|
||||
|
@ -3256,7 +3265,7 @@ namespace Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 欢迎回来 的本地化字符串。
|
||||
/// 查找类似 欢迎回来 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string Welcome {
|
||||
get {
|
||||
|
@ -3265,7 +3274,7 @@ namespace Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 焊接管理 的本地化字符串。
|
||||
/// 查找类似 焊接管理 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string WeldingManage {
|
||||
get {
|
||||
|
|
|
@ -393,6 +393,9 @@
|
|||
<div class="jdtj-btn jdtj-btn-act" id="span_jdtj" onclick="jdtjOnclick(0)" style="cursor: pointer">
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,mainProject2_ProgressStatistics %>" />
|
||||
</div>
|
||||
<div class="jdtj-btn" onclick="jdtjOnclick(3)" id="span_quantityDoneJdtj" style="cursor: pointer">
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,mainProject2_QuantityDone %>" />
|
||||
</div>
|
||||
<div class="jdtj-btn" onclick="jdtjOnclick(1)" id="span_weekJdtj" style="cursor: pointer">
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,mainProject2_WeekPlanDone %>" />
|
||||
</div>
|
||||
|
@ -698,6 +701,7 @@
|
|||
function jdtjOnclick(objval) {
|
||||
if (objval == 1) {
|
||||
$("#span_jdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_quantityDoneJdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_weekJdtj").addClass("jdtj-btn-act");
|
||||
$("#span_monthJdtj").removeClass("jdtj-btn-act");
|
||||
$("#jdtj-content").show();
|
||||
|
@ -706,14 +710,25 @@
|
|||
$("#div_jdtjList").html('<%=WeekJdtjHtml%>');
|
||||
} else if (objval == 2) {
|
||||
$("#span_jdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_quantityDoneJdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_weekJdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_monthJdtj").addClass("jdtj-btn-act");
|
||||
$("#jdtj-content").show();
|
||||
$("#left_one").hide();
|
||||
$("#div_jdtjHead").html('<%=MonthJdtjHead%>');
|
||||
$("#div_jdtjList").html('<%=MonthJdtjHtml%>');
|
||||
} else if (objval == 3) {
|
||||
$("#span_jdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_quantityDoneJdtj").addClass("jdtj-btn-act");
|
||||
$("#span_weekJdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_monthJdtj").removeClass("jdtj-btn-act");
|
||||
$("#jdtj-content").show();
|
||||
$("#left_one").hide();
|
||||
$("#div_jdtjHead").html('<%=QuantityDoneJdtjHead%>');
|
||||
$("#div_jdtjList").html('<%=QuantityDoneJdtjHtml%>');
|
||||
} else {
|
||||
$("#span_jdtj").addClass("jdtj-btn-act");
|
||||
$("#span_quantityDoneJdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_weekJdtj").removeClass("jdtj-btn-act");
|
||||
$("#span_monthJdtj").removeClass("jdtj-btn-act");
|
||||
$("#jdtj-content").hide();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1187,6 +1189,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;
|
||||
|
|
|
@ -10367,6 +10367,14 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<View_JDGL_QuantityCompletionDone> View_JDGL_QuantityCompletionDone
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<View_JDGL_QuantityCompletionDone>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<View_JDGL_SteelStructureCompletion> View_JDGL_SteelStructureCompletion
|
||||
{
|
||||
get
|
||||
|
@ -350495,7 +350503,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(50)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(500)")]
|
||||
public string Address
|
||||
{
|
||||
get
|
||||
|
@ -437486,6 +437494,87 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_JDGL_QuantityCompletionDone")]
|
||||
public partial class View_JDGL_QuantityCompletionDone
|
||||
{
|
||||
|
||||
private string _QuantityListId;
|
||||
|
||||
private string _ProjectId;
|
||||
|
||||
private System.Nullable<System.DateTime> _Months;
|
||||
|
||||
private System.Nullable<decimal> _Rate;
|
||||
|
||||
public View_JDGL_QuantityCompletionDone()
|
||||
{
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_QuantityListId", DbType="NVarChar(50)")]
|
||||
public string QuantityListId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._QuantityListId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._QuantityListId != value))
|
||||
{
|
||||
this._QuantityListId = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ProjectId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ProjectId != value))
|
||||
{
|
||||
this._ProjectId = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Months", DbType="DateTime")]
|
||||
public System.Nullable<System.DateTime> Months
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Months;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Months != value))
|
||||
{
|
||||
this._Months = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rate", DbType="Decimal(25,12)")]
|
||||
public System.Nullable<decimal> Rate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Rate;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Rate != value))
|
||||
{
|
||||
this._Rate = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_JDGL_SteelStructureCompletion")]
|
||||
public partial class View_JDGL_SteelStructureCompletion
|
||||
{
|
||||
|
|
|
@ -25,4 +25,13 @@ namespace Model
|
|||
public List<PieData> pieData { get; set; }
|
||||
public List<string> loc { get; set; }
|
||||
}
|
||||
|
||||
public class Serie
|
||||
{
|
||||
public string name { get; set; }
|
||||
public string type { get; set; }
|
||||
public string stack { get; set; }
|
||||
//public List<double> data { get; set; }
|
||||
public List<string> data { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue