提交代码
This commit is contained in:
@@ -126,7 +126,7 @@ namespace FineUIPro.Web.common
|
||||
string strSql = @"select ProjectId,TotalDin,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 SUM(ISNULL(Size,0)) FROM dbo.HJGL_WeldJoint WHERE ProjectId=b.ProjectId) AS DECIMAL(12,3)) AS TotalDin,
|
||||
(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
|
||||
from Base_Project b) v where ProjectId=@ProjectId ";
|
||||
|
||||
@@ -150,12 +150,19 @@ namespace FineUIPro.Web.common
|
||||
/// </summary>
|
||||
private void BindGrid2(string unitWorkId)
|
||||
{
|
||||
string strSql = @"select UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0
|
||||
string strSql = @"select '工厂预制' as PipeArea,UnitWorkId,TotalDin,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 SUM(ISNULL(Size,0)) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId) 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 jot.WeldingDailyId IS NOT NULL) AS DECIMAL(12,3)) AS FinishSize
|
||||
from WBS_UnitWork b) v where UnitWorkId=@UnitWorkId ";
|
||||
(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') 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.WeldingDailyId IS NOT NULL) 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
|
||||
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') 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) 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));
|
||||
@@ -166,10 +173,14 @@ namespace FineUIPro.Web.common
|
||||
var table = GetPagedDataTable(Grid2, tb);
|
||||
Grid2.DataSource = table;
|
||||
Grid2.DataBind();
|
||||
decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[0].ToString());
|
||||
decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[1].ToString());
|
||||
decimal notCompleteDin = totalDin - finishSize;
|
||||
this.lbNotCompleteDin.Text = notCompleteDin.ToString();
|
||||
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
|
||||
|
||||
@@ -178,26 +189,26 @@ namespace FineUIPro.Web.common
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnQuery_Click(object sender, EventArgs e)
|
||||
protected void btnQuery1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.tvControlItem.SelectedNodeID.Length > 1)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtLeaveDay.Text.Trim()))
|
||||
if (string.IsNullOrEmpty(this.txtLeaveDay1.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请输入剩余工期(天)!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.txtWorkEfficiency.Text.Trim()))
|
||||
if (string.IsNullOrEmpty(this.txtWorkEfficiency1.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请输入日工效!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[0].ToString());
|
||||
decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[1].ToString());
|
||||
decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[1].ToString());
|
||||
decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[2].ToString());
|
||||
decimal notCompleteDin = totalDin - finishSize;
|
||||
this.lbNotCompleteDin.Text = notCompleteDin.ToString();
|
||||
decimal leaveDay = Funs.GetNewDecimalOrZero(this.txtLeaveDay.Text.Trim());
|
||||
decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiency.Text.Trim());
|
||||
this.lbNotCompleteDin1.Text = notCompleteDin.ToString();
|
||||
decimal leaveDay = Funs.GetNewDecimalOrZero(this.txtLeaveDay1.Text.Trim());
|
||||
decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiency1.Text.Trim());
|
||||
if (notCompleteDin > 0)
|
||||
{
|
||||
if (leaveDay == 0)
|
||||
@@ -210,11 +221,63 @@ namespace FineUIPro.Web.common
|
||||
ShowNotify("日工效为0!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.lbNeedWelderNum.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString();
|
||||
this.lbNeedWelderNum1.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("未完成达因为0!", MessageBoxIcon.Warning);
|
||||
ShowNotify("工厂预制未完成达因为0!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择单位工程", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnQuery2_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.tvControlItem.SelectedNodeID.Length > 1)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtLeaveDay1.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请输入剩余工期(天)!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.txtWorkEfficiency1.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请输入日工效!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[1].ToString());
|
||||
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());
|
||||
decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiency2.Text.Trim());
|
||||
if (notCompleteDin > 0)
|
||||
{
|
||||
if (leaveDay == 0)
|
||||
{
|
||||
ShowNotify("剩余工期(天)为0!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (workEfficiency == 0)
|
||||
{
|
||||
ShowNotify("日工效为0!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.lbNeedWelderNum2.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("现场安装未完成达因为0!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user