diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index 8721a6eb..1cfd69fd 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -1250,6 +1250,59 @@ namespace BLL //return TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddSeconds(timestamp); } + #region 去除后面多余的零 + + /// + /// 去除后面多余的零 + /// + /// + /// + 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; + } + + /// + /// 去除后面多余的零 + /// + /// + /// + 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; diff --git a/SGGL/FineUIPro.Web/App_GlobalResources/Lan.en-US.resx b/SGGL/FineUIPro.Web/App_GlobalResources/Lan.en-US.resx index 3e0b1e97..6a7d2faa 100644 --- a/SGGL/FineUIPro.Web/App_GlobalResources/Lan.en-US.resx +++ b/SGGL/FineUIPro.Web/App_GlobalResources/Lan.en-US.resx @@ -1352,4 +1352,8 @@ Completion status of weekly plan 鍛ㄨ鍒掑畬鎴愭儏鍐 + + Completion status of engineering quantity + 宸ョ▼閲忓畬鎴愭儏鍐 + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/App_GlobalResources/Lan.resx b/SGGL/FineUIPro.Web/App_GlobalResources/Lan.resx index c8074f33..6d3f1356 100644 --- a/SGGL/FineUIPro.Web/App_GlobalResources/Lan.resx +++ b/SGGL/FineUIPro.Web/App_GlobalResources/Lan.resx @@ -1197,4 +1197,7 @@ 鍛ㄨ鍒掑畬鎴愭儏鍐 + + 宸ョ▼閲忓畬鎴愭儏鍐 + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/App_GlobalResources/Lan.zh-CN.resx b/SGGL/FineUIPro.Web/App_GlobalResources/Lan.zh-CN.resx index 0d494478..12f7a492 100644 --- a/SGGL/FineUIPro.Web/App_GlobalResources/Lan.zh-CN.resx +++ b/SGGL/FineUIPro.Web/App_GlobalResources/Lan.zh-CN.resx @@ -1194,4 +1194,7 @@ 鍛ㄨ鍒掑畬鎴愭儏鍐 + + 宸ョ▼閲忓畬鎴愭儏鍐 + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/App_GlobalResources/Lan1.designer.cs b/SGGL/FineUIPro.Web/App_GlobalResources/Lan1.designer.cs index 585e3016..e202957b 100644 --- a/SGGL/FineUIPro.Web/App_GlobalResources/Lan1.designer.cs +++ b/SGGL/FineUIPro.Web/App_GlobalResources/Lan1.designer.cs @@ -1185,6 +1185,15 @@ namespace Resources { } } + /// + /// 鏌ユ壘绫讳技 宸ョ▼閲忓畬鎴愭儏鍐 鐨勬湰鍦板寲瀛楃涓层 + /// + internal static string mainProject2_QuantityDone { + get { + return ResourceManager.GetString("mainProject2_QuantityDone", resourceCulture); + } + } + /// /// 鏌ユ壘绫讳技 璐ㄩ噺瀹夊叏棰勮 鐨勬湰鍦板寲瀛楃涓层 /// @@ -3067,7 +3076,7 @@ namespace Resources { } /// - /// 鏌ユ壘绫讳技 娆㈣繋鍥炴潵 鐨勬湰鍦板寲瀛楃涓层 + /// 鏌ユ壘绫讳技 娆㈣繋鍥炴潵 鐨勬湰鍦板寲瀛楃涓层 /// internal static string String1 { get { @@ -3076,7 +3085,7 @@ namespace Resources { } /// - /// 鏌ユ壘绫讳技 鍒嗗寘绠$悊 鐨勬湰鍦板寲瀛楃涓层 + /// 鏌ユ壘绫讳技 鍒嗗寘绠$悊 鐨勬湰鍦板寲瀛楃涓层 /// internal static string SubManagement { get { @@ -3256,7 +3265,7 @@ namespace Resources { } /// - /// 鏌ユ壘绫讳技 娆㈣繋鍥炴潵 鐨勬湰鍦板寲瀛楃涓层 + /// 鏌ユ壘绫讳技 娆㈣繋鍥炴潵 鐨勬湰鍦板寲瀛楃涓层 /// internal static string Welcome { get { @@ -3265,7 +3274,7 @@ namespace Resources { } /// - /// 鏌ユ壘绫讳技 鐒婃帴绠$悊 鐨勬湰鍦板寲瀛楃涓层 + /// 鏌ユ壘绫讳技 鐒婃帴绠$悊 鐨勬湰鍦板寲瀛楃涓层 /// internal static string WeldingManage { get { diff --git a/SGGL/FineUIPro.Web/common/mainProject2.aspx b/SGGL/FineUIPro.Web/common/mainProject2.aspx index 08d48f27..37f61472 100644 --- a/SGGL/FineUIPro.Web/common/mainProject2.aspx +++ b/SGGL/FineUIPro.Web/common/mainProject2.aspx @@ -393,6 +393,9 @@
+
+ +
@@ -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(); diff --git a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs index fb70fd73..f42cbee1 100644 --- a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs @@ -109,6 +109,7 @@ namespace FineUIPro.Web.common var personTask = GetPersonAsync(); var weekJdtjTask = GetWeekJDAsync(); var monthJdtjTask = GetMonthJDAsync(); + var quantityDoneJDTask = GetQuantityDoneJDAsync(); var otherTasks = new List { 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 = "
绫诲瀷
璁捐鏁伴噺

鏈湡

璁″垝瀹為檯瀹屾垚鐜

绱

璁″垝瀹為檯瀹屾垚鐜

瀹屾垚鐜
"; + //protected string QuantityDoneJdtjHead = "
绫诲瀷
鍗曚綅
璁捐鏁伴噺

鏈湡

璁″垝瀹屾垚瀹為檯瀹屾垚瀹屾垚鐜

绱

璁″垝瀹屾垚瀹為檯瀹屾垚瀹屾垚鐜

瀹屾垚鐜
"; + + /// + /// 宸ョ▼閲忓畬鎴愭儏鍐 + /// + /// + protected async Task 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 listStr = new List(); + 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("
"); + sb.Append($"
{name}锛坽unit}锛
"); + //sb.Append($"
{unit}
"); + sb.Append($"
{designNum}
"); + sb.Append($"

{planNum}{realNum}{rate}

"); + sb.Append($"

{totalPlanNum}{totalRealNum}{totalRate}

"); + sb.Append($"
{sumRate}
"); + sb.Append("
"); + } + doneJdtjHtml = sb.ToString(); + return doneJdtjHtml; + }); + } + + + #endregion + #region 杩涘害缁熻 protected string WeekJdtjHtml; diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 555283ec..e6e76a75 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -10367,6 +10367,14 @@ namespace Model } } + public System.Data.Linq.Table View_JDGL_QuantityCompletionDone + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table 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 _Months; + + private System.Nullable _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 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 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 { diff --git a/SGGL/Model/SingleSerie.cs b/SGGL/Model/SingleSerie.cs index 3746047c..829b1d8b 100644 --- a/SGGL/Model/SingleSerie.cs +++ b/SGGL/Model/SingleSerie.cs @@ -25,4 +25,13 @@ namespace Model public List pieData { get; set; } public List loc { get; set; } } + + public class Serie + { + public string name { get; set; } + public string type { get; set; } + public string stack { get; set; } + //public List data { get; set; } + public List data { get; set; } + } }