报表备注可以修改

This commit is contained in:
2024-07-30 15:15:46 +08:00
parent 1307746137
commit c02a6fe294
4 changed files with 278 additions and 154 deletions
@@ -43,20 +43,21 @@ namespace FineUIPro.Web.Transfer.Chart
//计算本周日期段
DateTime today = DateTime.Today;
int dayOfWeek = (int)today.DayOfWeek;
DateTime startWeebTime=Convert.ToDateTime(today.AddDays(-dayOfWeek + 1).ToString("yyyy-MM-dd")+" 00:00:00");
DateTime endWeebTime= Convert.ToDateTime(today.AddDays(-dayOfWeek + 7).ToString("yyyy-MM-dd") + " 23:59:59");
DateTime startWeebTime = Convert.ToDateTime(today.AddDays(-dayOfWeek + 1).ToString("yyyy-MM-dd") + " 00:00:00");
DateTime endWeebTime = Convert.ToDateTime(today.AddDays(-dayOfWeek + 7).ToString("yyyy-MM-dd") + " 23:59:59");
StringBuilder strSql = new StringBuilder("");
strSql.AppendLine(" IF OBJECT_ID('tempdb..#AllLHCSystemListTemp') IS NOT NULL drop table #AllLHCSystemListTemp; ");
strSql.AppendLine(" IF OBJECT_ID('tempdb..#LHCSystemListTemp') IS NOT NULL drop table #LHCSystemListTemp; ");
strSql.AppendLine(" select * INTO #AllLHCSystemListTemp from Transfer_LHCSystemList(NOLOCK) where ProjectId =@ProjectId; ");
strSql.AppendLine(" select isnull([Type],'0') [Type],(CASE isnull([Type],'0') WHEN '1' THEN 'Non Process system' ELSE 'Process System' END) Category,count(1) System_Qty ");
strSql.AppendLine(",cast(0 as decimal(18,2)) Cumulative_Plan,cast(0 as decimal(18,2)) Cumulative_Actual ,cast(0 as decimal(18,2)) Week_Plan,cast(0 as decimal(18,2)) Week_Actual ");
strSql.AppendLine(",cast(0 as decimal(18,2)) Cumulative_Plan,cast(0 as decimal(18,2)) Cumulative_Actual ,cast(0 as decimal(18,2)) Week_Plan,cast(0 as decimal(18,2)) Week_Actual,cast('' as nvarchar(600)) Remarks ");
strSql.AppendLine(" INTO #LHCSystemListTemp from #AllLHCSystemListTemp group by isnull([Type],'0'); ");
strSql.AppendLine(" update a set a.Cumulative_Plan=(select count(1) from #AllLHCSystemListTemp b where isnull(b.[Type],'0')=a.[Type] AND isnull(b.PlanFinishofTestingDate,'')<>'') ");
strSql.AppendLine(" ,a.Cumulative_Actual=(select count(1) from #AllLHCSystemListTemp b where isnull(b.[Type],'0')=a.[Type] AND isnull(b.ActualFinishedDate,'')<>'') ");
strSql.AppendLine(" ,a.Week_Plan=(select count(1) from #AllLHCSystemListTemp b where isnull(b.[Type],'0')=a.[Type] AND b.PlanFinishofTestingDate>=@StartWeebTime AND b.PlanFinishofTestingDate<=@EndWeebTime) ");
strSql.AppendLine(" ,a.Week_Actual=(select count(1) from #AllLHCSystemListTemp b where isnull(b.[Type],'0')=a.[Type] AND b.ActualFinishedDate>=@StartWeebTime AND b.ActualFinishedDate<=@EndWeebTime) ");
strSql.AppendLine(" ,a.Remarks=(select top 1 Remarks from Transfer_SystemStatusRemarks b(NOLOCK) where a.Category=b.TypeName and b.ProjectId=@ProjectId) ");
strSql.AppendLine(" from #LHCSystemListTemp a; ");
strSql.AppendLine(" select * from #LHCSystemListTemp; ");
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
@@ -73,7 +74,7 @@ namespace FineUIPro.Web.Transfer.Chart
int Cumulative_Actual = 0;
int Week_Plan = 0;
int Week_Actual = 0;
int System_Qty=0;
int System_Qty = 0;
foreach (DataRow row in tb.Rows)
{
System_Qty += Convert.ToInt32(row["System_Qty"]);
@@ -124,7 +125,7 @@ namespace FineUIPro.Web.Transfer.Chart
DateTime endTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 23:59:59");
rowTime["计划完成数量"] = forms.Where(x => x.PlanFinishofTestingDate <= endTime).Count();
rowTime["实际完成数量"] = forms.Where(x => x.ActualFinishedDate <= endTime).Count();
rowTime["进行中移交包数量"] = forms.Where(x => x.UpdateTime <= endTime && x.Status== "In progress").Count();
rowTime["进行中移交包数量"] = forms.Where(x => x.UpdateTime <= endTime && x.Status == "In progress").Count();
dtTime.Rows.Add(rowTime);
}
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
@@ -187,5 +188,38 @@ namespace FineUIPro.Web.Transfer.Chart
{
this.AnalyseData();
}
/// <summary>
/// 修改后事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_AfterEdit(object sender, GridAfterEditEventArgs e)
{
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid1.GetModifiedDict();
foreach (int rowIndex in modifiedDict.Keys)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
string remarks = modifiedDict[rowIndex]["Remarks"].ToString();
var updateRemarks = Funs.DB.Transfer_SystemStatusRemarks.FirstOrDefault(p => p.TypeName == rowID && p.ProjectId == this.CurrUser.LoginProjectId);
if (updateRemarks != null)
{
updateRemarks.Remarks = remarks;
Funs.DB.SubmitChanges();
}
else
{
Model.Transfer_SystemStatusRemarks AddRemarks = new Model.Transfer_SystemStatusRemarks();
AddRemarks.Id = Guid.NewGuid().ToString();
AddRemarks.ProjectId = this.CurrUser.LoginProjectId;
AddRemarks.TypeName= rowID;
AddRemarks.Remarks= remarks;
Funs.DB.Transfer_SystemStatusRemarks.InsertOnSubmit(AddRemarks);
Funs.DB.SubmitChanges();
}
}
}
}
}