提交代码

This commit is contained in:
2024-05-10 15:46:52 +08:00
parent 1c23ce814d
commit 563d401af6
30 changed files with 2014 additions and 98 deletions
+19 -29
View File
@@ -19,7 +19,7 @@ namespace FineUIPro.Web.JDGL.Check
{
GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("MonthPlanEdit.aspx") + "return false;";
this.txtMonths.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.txtMonths.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
BindGrid();
}
}
@@ -51,6 +51,7 @@ namespace FineUIPro.Web.JDGL.Check
protected void btnModify_Click(object sender, EventArgs e)
{
Window1.Title = "录入";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MonthPlanEdit.aspx?Months={0}", this.txtMonths.Text, "编辑 - ")));
}
@@ -59,34 +60,9 @@ namespace FineUIPro.Web.JDGL.Check
/// </summary>
private void BindGrid()
{
string strSql = @"select qc.MonthPlanId,(select PlanNum from JDGL_MonthPlan where QuantityListId=ql.QuantityListId and Months=@month) as PlanNum,
(select RealNum from JDGL_MonthPlan where QuantityListId=ql.QuantityListId and Months=@month) as RealNum,
(select NextNum from JDGL_MonthPlan 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_MonthPlan where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) as TotalPlanNum,
CONVERT(FLOAT, (select sum(ISNULL(RealNum, 0)) from JDGL_MonthPlan 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_MonthPlan where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) WHEN 0 THEN 0
ELSE 100 * (select sum(ISNULL(RealNum, 0)) from JDGL_MonthPlan where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) / (1.0 * (select sum(ISNULL(PlanNum, 0)) from JDGL_MonthPlan 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_MonthPlan 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_MonthPlan where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months < qc.Months)) as LastTotalPlanNum,
CONVERT(FLOAT, (select sum(ISNULL(RealNum, 0)) from JDGL_MonthPlan where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months < qc.Months)) as LastTotalRealNum
from[dbo].JDGL_QuantityList ql
left join dbo.[JDGL_MonthPlan] qc on ql.QuantityListId=qc.QuantityListId
where qc.MonthPlanId=(select top 1 MonthPlanId from[JDGL_MonthPlan] 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";
//string strSql = @"select *
// from dbo.View_JDGL_MonthPlan qc
// where qc.ProjectId=@ProjectId order by qc.SortIndex, qc.Name";
string strSql = @"select mp.*,u.UnitName,us.UserName as DutyPersonName from [dbo].[JDGL_MonthPlan] mp
left join Base_Unit u on u.UnitId=mp.UnitId
left join Sys_User us on us.UserId=mp.DutyPerson where mp.ProjectId=@ProjectId and mp.Months=@month order by mp.SortIndex";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@month", string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(this.txtMonths.Text.Trim() + "-01"))));
@@ -167,6 +143,7 @@ where qc.MonthPlanId=(select top 1 MonthPlanId from[JDGL_MonthPlan] q where q.Qu
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
Window1.Title = "导入";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MonthPlanIn.aspx?ProjectId={0}", this.CurrUser.LoginProjectId, "导入 - ")));
}
@@ -180,5 +157,18 @@ where qc.MonthPlanId=(select top 1 MonthPlanId from[JDGL_MonthPlan] q where q.Qu
BindGrid();
}
#endregion
#region
/// <summary>
/// 统计分析
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
Window1.Title = "统计";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MonthPlanStatisc.aspx", "统计 - ")));
}
#endregion
}
}