1责任人进度完成情况
This commit is contained in:
@@ -18,15 +18,18 @@ namespace FineUIPro.Web.DataShow
|
||||
Funs.DropDownPageSize(this.ddlPageSize2);
|
||||
Funs.DropDownPageSize(this.ddlPageSize3);
|
||||
Funs.DropDownPageSize(this.ddlPageSize4);
|
||||
Funs.DropDownPageSize(this.ddlPageSize5);
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
ddlPageSize2.SelectedValue = Grid2.PageSize.ToString();
|
||||
ddlPageSize3.SelectedValue = Grid3.PageSize.ToString();
|
||||
ddlPageSize4.SelectedValue = Grid4.PageSize.ToString();
|
||||
ddlPageSize5.SelectedValue = Grid5.PageSize.ToString();
|
||||
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
|
||||
BLL.ProjectService.InitProjectDropDownList(this.drpProject2, true);
|
||||
BLL.UserService.InitSGBUser(this.drpDutyPerson2, true);
|
||||
BLL.ProjectService.InitProjectDropDownList(this.drpProject3, true);
|
||||
BLL.UserService.InitSGBUser(this.drpDutyPerson3, true);
|
||||
BLL.UserService.InitSGBUser(this.drpDutyPerson5, true);
|
||||
BLL.ProjectService.InitProjectDropDownList(this.drpProject4, true);
|
||||
BindGrid1();
|
||||
|
||||
@@ -40,6 +43,9 @@ namespace FineUIPro.Web.DataShow
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目基本情况
|
||||
/// </summary>
|
||||
private void BindGrid1()
|
||||
{
|
||||
string strSql = @"select p.ProjectId,ProjectCode, ProjectName,(select sum(isnull(RealNum,0)) from JDGL_ProgressCompletion a where a.ProjectId=p.ProjectId) as RealNum,
|
||||
@@ -91,8 +97,9 @@ left join (
|
||||
BindGrid2();
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// 月计划
|
||||
/// </summary>
|
||||
private void BindGrid2()
|
||||
{
|
||||
@@ -173,7 +180,7 @@ left join (
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// 周计划
|
||||
/// </summary>
|
||||
private void BindGrid3()
|
||||
{
|
||||
@@ -253,7 +260,7 @@ left join (
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// 实物工程量
|
||||
/// </summary>
|
||||
private void BindGrid4()
|
||||
{
|
||||
@@ -297,6 +304,53 @@ left join (select PlanNum,RealNum,NextNum,QuantityListId from JDGL_QuantityCompl
|
||||
Grid4.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 五环责任人完成情况
|
||||
/// </summary>
|
||||
private void BindGrid5()
|
||||
{
|
||||
string strSql = $@"SELECT p.UserId,p.UserCode,p.UserName, cast((case when isnull(MonthPlan.MonthPlanNum,0)=0 then 0 else isnull(MonthPlanOK.MonthPlanOKNum,0)/(1.0 *isnull(MonthPlan.MonthPlanNum,0))*100 end) as DECIMAL(19,2)) as MonthPlanRate,
|
||||
cast((case when isnull(WeekPlan.WeekPlanNum,0)=0 then 0 else isnull(WeekPlanOK.WeekPlanOKNum,0)/(1.0 *isnull(WeekPlan.WeekPlanNum,0))*100 end) as DECIMAL(19,2)) as WeekPlanRate
|
||||
FROM Sys_User p
|
||||
LEFT JOIN (
|
||||
SELECT COUNT(w.WeekPlanId) AS WeekPlanNum,w.pDutyPerson
|
||||
FROM (SELECT Item.value('.', 'NVARCHAR(MAX)') AS pDutyPerson,jplan.* FROM JDGL_WeekPlan as jplan CROSS APPLY (SELECT CAST('<M>' + REPLACE(DutyPerson, ',', '</M><M>') + '</M>' AS XML)) AS A(x) CROSS APPLY x.nodes('/M') AS B(Item)) w
|
||||
GROUP BY w.pDutyPerson
|
||||
) AS WeekPlan ON WeekPlan.pDutyPerson =p.UserId
|
||||
LEFT JOIN (
|
||||
SELECT COUNT(w.WeekPlanId) AS WeekPlanOKNum,w.pDutyPerson
|
||||
FROM (SELECT Item.value('.', 'NVARCHAR(MAX)') AS pDutyPerson,jplan.* FROM JDGL_WeekPlan as jplan CROSS APPLY (SELECT CAST('<M>' + REPLACE(DutyPerson, ',', '</M><M>') + '</M>' AS XML)) AS A(x) CROSS APPLY x.nodes('/M') AS B(Item)) w
|
||||
WHERE w.IsOK=1
|
||||
GROUP BY w.pDutyPerson
|
||||
) AS WeekPlanOK ON WeekPlanOK.pDutyPerson=p.UserId
|
||||
LEFT JOIN (
|
||||
SELECT COUNT(w.MonthPlanId) AS MonthPlanNum,w.pDutyPerson
|
||||
FROM (SELECT Item.value('.', 'NVARCHAR(MAX)') AS pDutyPerson,jplan.* FROM JDGL_MonthPlan as jplan CROSS APPLY (SELECT CAST('<M>' + REPLACE(DutyPerson, ',', '</M><M>') + '</M>' AS XML)) AS A(x) CROSS APPLY x.nodes('/M') AS B(Item)) w
|
||||
GROUP BY w.pDutyPerson
|
||||
) AS MonthPlan ON MonthPlan.pDutyPerson=p.UserId
|
||||
LEFT JOIN (
|
||||
SELECT COUNT(w.MonthPlanId) AS MonthPlanOKNum,w.pDutyPerson
|
||||
FROM (SELECT Item.value('.', 'NVARCHAR(MAX)') AS pDutyPerson,jplan.* FROM JDGL_MonthPlan as jplan CROSS APPLY (SELECT CAST('<M>' + REPLACE(DutyPerson, ',', '</M><M>') + '</M>' AS XML)) AS A(x) CROSS APPLY x.nodes('/M') AS B(Item)) w
|
||||
WHERE w.RealDate is not null and w.RealDate<=w.PlanDate
|
||||
GROUP BY w.pDutyPerson
|
||||
) AS MonthPlanOK ON MonthPlanOK.pDutyPerson=p.UserId
|
||||
WHERE p.IsPost=1 and p.UnitId='{Const.UnitId_CWCEC}' and p.DepartId='{Const.Depart_constructionId}' ";// ORDER BY p.UserCode,p.UserName
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
string cpara = string.Empty;
|
||||
if (this.drpDutyPerson5.SelectedValue != Const._Null)
|
||||
{
|
||||
strSql += " AND p.UserId = @UserId";
|
||||
listStr.Add(new SqlParameter("@UserId", this.drpDutyPerson5.SelectedValue));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid5.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid5, tb);
|
||||
Grid5.DataSource = table;
|
||||
Grid5.DataBind();
|
||||
}
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
@@ -472,6 +526,51 @@ left join (select PlanNum,RealNum,NextNum,QuantityListId from JDGL_QuantityCompl
|
||||
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox5_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid5();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 表排序、分页、关闭窗口
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid5_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
BindGrid5();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid5_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
BindGrid5();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize5_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid5.PageSize = Convert.ToInt32(ddlPageSize5.SelectedValue);
|
||||
BindGrid5();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
protected void TabStrip1_TabIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
@@ -496,6 +595,13 @@ left join (select PlanNum,RealNum,NextNum,QuantityListId from JDGL_QuantityCompl
|
||||
BindGrid4();
|
||||
}
|
||||
}
|
||||
else if (TabStrip1.ActiveTabIndex == 4)
|
||||
{
|
||||
if (this.Grid5.Rows.Count == 0)
|
||||
{
|
||||
BindGrid5();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -564,6 +670,35 @@ left join (select PlanNum,RealNum,NextNum,QuantityListId from JDGL_QuantityCompl
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("JDMonthDetail.aspx?projectId={0}&month={1}", projectId, month, "查看明细 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grid双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid5_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.ViewDutyPersonDetail();
|
||||
}
|
||||
/// <summary>
|
||||
/// 查看
|
||||
/// </summary>
|
||||
private void ViewDutyPersonDetail()
|
||||
{
|
||||
if (Grid5.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
else if (Grid5.SelectedRowIndexArray.Length > 1)
|
||||
{
|
||||
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
string userId = Grid5.SelectedRowID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("JDDutyPersonDetail.aspx?UserId={0}", userId, "查看明细 - ")));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user