提交代码
This commit is contained in:
@@ -17,10 +17,17 @@ namespace FineUIPro.Web.common
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.InitTreeMenu();//加载树
|
||||
this.txtWeldingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
BindGrid1();
|
||||
}
|
||||
}
|
||||
|
||||
protected void WeldingDateText_OnTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid1();
|
||||
BindGrid2(this.tvControlItem.SelectedNodeID);
|
||||
}
|
||||
|
||||
#region 加载树装置-单位-工作区
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
@@ -123,15 +130,17 @@ namespace FineUIPro.Web.common
|
||||
/// </summary>
|
||||
private void BindGrid1()
|
||||
{
|
||||
string strSql = @"select ProjectId,TotalDin,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0
|
||||
string strSql = @"select ProjectId,TotalDin,TodayFinishSize,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0
|
||||
ELSE 100.0 * ISNULL(FinishSize,0)/(1.0 * TotalDin) END) AS DECIMAL(8,2))))+'%'
|
||||
AS Rate from
|
||||
(select ProjectId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint WHERE ProjectId=b.ProjectId) AS DECIMAL(12,3)) AS TotalDin,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot WHERE ProjectId=b.ProjectId AND jot.WeldingDailyId IS NOT NULL) AS DECIMAL(12,3)) AS FinishSize
|
||||
(select b.ProjectId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint WHERE ProjectId=b.ProjectId) AS DECIMAL(12,3)) AS TotalDin,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_WeldingDaily d on d.WeldingDailyId=jot.WeldingDailyId WHERE jot.ProjectId=b.ProjectId AND jot.WeldingDailyId IS NOT NULL and d.WeldingDate=@WeldingDate) AS DECIMAL(12,3)) AS TodayFinishSize,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_WeldingDaily d on d.WeldingDailyId=jot.WeldingDailyId WHERE jot.ProjectId=b.ProjectId AND jot.WeldingDailyId IS NOT NULL and d.WeldingDate<=@WeldingDate) AS DECIMAL(12,3)) AS FinishSize
|
||||
from Base_Project b) v where ProjectId=@ProjectId ";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", (CurrUser != null) ? CurrUser.LoginProjectId : ""));
|
||||
listStr.Add(new SqlParameter("@WeldingDate", this.txtWeldingDate.Text.Trim()));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
@@ -150,22 +159,25 @@ namespace FineUIPro.Web.common
|
||||
/// </summary>
|
||||
private void BindGrid2(string unitWorkId)
|
||||
{
|
||||
string strSql = @"select '工厂预制' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0
|
||||
string strSql = @"select '工厂预制' as PipeArea,UnitWorkId,TotalDin,TodayFinishSize,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0
|
||||
ELSE 100.0 * ISNULL(FinishSize,0)/(1.0 * TotalDin) END) AS DECIMAL(8,2))))+'%'
|
||||
AS Rate from
|
||||
(select UnitWorkId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='预制口') AS DECIMAL(12,3)) AS TotalDin,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='预制口' AND jot.WeldingDailyId IS NOT NULL) AS DECIMAL(12,3)) AS FinishSize
|
||||
(select b.UnitWorkId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='预制口') AS DECIMAL(12,3)) AS TotalDin,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId left join dbo.HJGL_WeldingDaily d on d.WeldingDailyId=jot.WeldingDailyId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='预制口' AND jot.WeldingDailyId IS NOT NULL and d.WeldingDate=@WeldingDate) AS DECIMAL(12,3)) AS TodayFinishSize,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId left join dbo.HJGL_WeldingDaily d on d.WeldingDailyId=jot.WeldingDailyId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='预制口' AND jot.WeldingDailyId IS NOT NULL and d.WeldingDate<=@WeldingDate) AS DECIMAL(12,3)) AS FinishSize
|
||||
from WBS_UnitWork b) v where UnitWorkId=@UnitWorkId
|
||||
union
|
||||
select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0
|
||||
select '现场安装' as PipeArea,UnitWorkId,TotalDin,TodayFinishSize,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0
|
||||
ELSE 100.0 * ISNULL(FinishSize,0)/(1.0 * TotalDin) END) AS DECIMAL(8,2))))+'%'
|
||||
AS Rate from
|
||||
(select UnitWorkId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='2')+(SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='安装口') AS DECIMAL(12,3)) AS TotalDin,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='2' AND jot.WeldingDailyId IS NOT NULL)+(SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='安装口' AND jot.WeldingDailyId IS NOT NULL) AS DECIMAL(12,3)) AS FinishSize
|
||||
(select b.UnitWorkId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='2')+(SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='安装口') AS DECIMAL(12,3)) AS TotalDin,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId left join dbo.HJGL_WeldingDaily d on d.WeldingDailyId=jot.WeldingDailyId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='2' AND jot.WeldingDailyId IS NOT NULL and d.WeldingDate=@WeldingDate)+(SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId left join dbo.HJGL_WeldingDaily d on d.WeldingDailyId=jot.WeldingDailyId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='安装口' AND jot.WeldingDailyId IS NOT NULL and d.WeldingDate=@WeldingDate) AS DECIMAL(12,3)) AS TodayFinishSize,
|
||||
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId left join dbo.HJGL_WeldingDaily d on d.WeldingDailyId=jot.WeldingDailyId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='2' AND jot.WeldingDailyId IS NOT NULL and d.WeldingDate<=@WeldingDate)+(SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId left join dbo.HJGL_WeldingDaily d on d.WeldingDailyId=jot.WeldingDailyId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' and jot.JointAttribute='安装口' AND jot.WeldingDailyId IS NOT NULL and d.WeldingDate<=@WeldingDate) AS DECIMAL(12,3)) AS FinishSize
|
||||
from WBS_UnitWork b) v where UnitWorkId=@UnitWorkId";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", unitWorkId));
|
||||
listStr.Add(new SqlParameter("@WeldingDate", this.txtWeldingDate.Text.Trim()));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid2.RecordCount = tb.Rows.Count;
|
||||
@@ -173,14 +185,17 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
var table = GetPagedDataTable(Grid2, tb);
|
||||
Grid2.DataSource = table;
|
||||
Grid2.DataBind();
|
||||
decimal totalDin1 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[1].ToString());
|
||||
decimal finishSize1 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[2].ToString());
|
||||
decimal notCompleteDin1 = totalDin1 - finishSize1;
|
||||
this.lbNotCompleteDin1.Text = notCompleteDin1.ToString();
|
||||
decimal totalDin2 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[1].ToString());
|
||||
decimal finishSize2 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[2].ToString());
|
||||
decimal notCompleteDin2 = totalDin2 - finishSize2;
|
||||
this.lbNotCompleteDin2.Text = notCompleteDin2.ToString();
|
||||
if (Grid2.RecordCount > 0)
|
||||
{
|
||||
decimal totalDin1 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[1].ToString());
|
||||
decimal finishSize1 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[2].ToString());
|
||||
decimal notCompleteDin1 = totalDin1 - finishSize1;
|
||||
this.lbNotCompleteDin1.Text = notCompleteDin1.ToString();
|
||||
decimal totalDin2 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[1].ToString());
|
||||
decimal finishSize2 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[2].ToString());
|
||||
decimal notCompleteDin2 = totalDin2 - finishSize2;
|
||||
this.lbNotCompleteDin2.Text = notCompleteDin2.ToString();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -193,9 +208,9 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
{
|
||||
if (this.tvControlItem.SelectedNodeID.Length > 1)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtLeaveDay1.Text.Trim()))
|
||||
if (string.IsNullOrEmpty(this.txtPlanEndDate1.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请输入剩余工期(天)!", MessageBoxIcon.Warning);
|
||||
ShowNotify("请输入计划完成日期!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.txtWorkEfficiency1.Text.Trim()))
|
||||
@@ -207,7 +222,8 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[2].ToString());
|
||||
decimal notCompleteDin = totalDin - finishSize;
|
||||
this.lbNotCompleteDin1.Text = notCompleteDin.ToString();
|
||||
decimal leaveDay = Funs.GetNewDecimalOrZero(this.txtLeaveDay1.Text.Trim());
|
||||
TimeSpan ts = (TimeSpan)(Funs.GetNewDateTime(this.txtPlanEndDate1.Text.Trim()) - Funs.GetNewDateTime(this.txtWeldingDate.Text.Trim()));
|
||||
decimal leaveDay = Convert.ToDecimal(ts.Days);
|
||||
decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiency1.Text.Trim());
|
||||
if (notCompleteDin > 0)
|
||||
{
|
||||
@@ -221,6 +237,7 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
ShowNotify("日工效为0!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.lbDayNeedSize1.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay)).ToString();
|
||||
this.lbNeedWelderNum1.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString();
|
||||
}
|
||||
else
|
||||
@@ -245,12 +262,12 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
{
|
||||
if (this.tvControlItem.SelectedNodeID.Length > 1)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtLeaveDay1.Text.Trim()))
|
||||
if (string.IsNullOrEmpty(this.txtPlanEndDate2.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请输入剩余工期(天)!", MessageBoxIcon.Warning);
|
||||
ShowNotify("请输入计划完成日期!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.txtWorkEfficiency1.Text.Trim()))
|
||||
if (string.IsNullOrEmpty(this.txtWorkEfficiency2.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请输入日工效!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
@@ -259,7 +276,8 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[2].ToString());
|
||||
decimal notCompleteDin = totalDin - finishSize;
|
||||
this.lbNotCompleteDin2.Text = notCompleteDin.ToString();
|
||||
decimal leaveDay = Funs.GetNewDecimalOrZero(this.txtLeaveDay2.Text.Trim());
|
||||
TimeSpan ts = (TimeSpan)(Funs.GetNewDateTime(this.txtPlanEndDate2.Text.Trim()) - Funs.GetNewDateTime(this.txtWeldingDate.Text.Trim()));
|
||||
decimal leaveDay = Convert.ToDecimal(ts.Days);
|
||||
decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiency2.Text.Trim());
|
||||
if (notCompleteDin > 0)
|
||||
{
|
||||
@@ -273,6 +291,7 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
ShowNotify("日工效为0!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.lbDayNeedSize2.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay)).ToString();
|
||||
this.lbNeedWelderNum2.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString();
|
||||
}
|
||||
else
|
||||
@@ -295,9 +314,9 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
/// <param name="e"></param>
|
||||
protected void btnQueryTotal_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtLeaveDayTotal.Text.Trim()))
|
||||
if (string.IsNullOrEmpty(this.txtPlanEndDate.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请输入剩余工期(天)!", MessageBoxIcon.Warning);
|
||||
ShowNotify("请输入计划完成日期!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.txtWorkEfficiencyTotal.Text.Trim()))
|
||||
@@ -308,7 +327,8 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[0].ToString());
|
||||
decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[1].ToString());
|
||||
decimal notCompleteDin = totalDin - finishSize;
|
||||
decimal leaveDay = Funs.GetNewDecimalOrZero(this.txtLeaveDayTotal.Text.Trim());
|
||||
TimeSpan ts= (TimeSpan)(Funs.GetNewDateTime(this.txtPlanEndDate.Text.Trim()) - Funs.GetNewDateTime(this.txtWeldingDate.Text.Trim()));
|
||||
decimal leaveDay = Convert.ToDecimal(ts.Days);
|
||||
decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiencyTotal.Text.Trim());
|
||||
if (notCompleteDin > 0)
|
||||
{
|
||||
@@ -322,6 +342,7 @@ select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHA
|
||||
ShowNotify("日工效为0!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.lbDayNeedSize.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay)).ToString();
|
||||
this.lbNeedWelderNumTotal.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user