移交统计报表修改
This commit is contained in:
		
							parent
							
								
									d0b610ae4d
								
							
						
					
					
						commit
						0de05c502d
					
				|  | @ -0,0 +1,2 @@ | ||||||
|  | update sys_menu set Menuname='全厂移交统计报表' where  MenuName='全厂移交统计表'; | ||||||
|  | update sys_menu set Menuname='全厂移交累积统计报表' where  MenuName='全厂移交统计递增表' | ||||||
|  | @ -144,6 +144,16 @@ namespace Web.Controls | ||||||
|                         chart1.Series[dataSourceTeam.DataPointName].IsValueShownAsLabel = true; |                         chart1.Series[dataSourceTeam.DataPointName].IsValueShownAsLabel = true; | ||||||
|                         chart1.Series[dataSourceTeam.DataPointName].BorderWidth = 2; |                         chart1.Series[dataSourceTeam.DataPointName].BorderWidth = 2; | ||||||
|                         chart1.Series[dataSourceTeam.DataPointName]["DrawingStyle"] = "Cylinder"; |                         chart1.Series[dataSourceTeam.DataPointName]["DrawingStyle"] = "Cylinder"; | ||||||
|  | 
 | ||||||
|  |                         if (dataSourceTeam.DataPointName == "Actual Finished") | ||||||
|  |                         { | ||||||
|  |                             chart1.Series[dataSourceTeam.DataPointName].Color = Color.Red; | ||||||
|  |                         } | ||||||
|  |                         else if (dataSourceTeam.DataPointName == "Plan Finished") | ||||||
|  |                         { | ||||||
|  |                             chart1.Series[dataSourceTeam.DataPointName].Color = Color.Blue; | ||||||
|  |                         } | ||||||
|  | 
 | ||||||
|                         foreach (Model.DataSourcePoint dataSourcePoint in dataSourceTeam.DataSourcePoints) |                         foreach (Model.DataSourcePoint dataSourcePoint in dataSourceTeam.DataSourcePoints) | ||||||
|                         { |                         { | ||||||
|                             chart1.Series[dataSourceTeam.DataPointName].Points.AddXY(dataSourcePoint.PointText, dataSourcePoint.PointValue); |                             chart1.Series[dataSourceTeam.DataPointName].Points.AddXY(dataSourcePoint.PointText, dataSourcePoint.PointValue); | ||||||
|  |  | ||||||
|  | @ -123,9 +123,10 @@ namespace FineUIPro.Web.Transfer.Chart | ||||||
| 
 | 
 | ||||||
|             DataTable dtTime = new DataTable(); |             DataTable dtTime = new DataTable(); | ||||||
|             dtTime.Columns.Add("日期", typeof(string)); |             dtTime.Columns.Add("日期", typeof(string)); | ||||||
|             dtTime.Columns.Add("Finished", typeof(string)); |             dtTime.Columns.Add("Plan Finished", typeof(string)); | ||||||
|             dtTime.Columns.Add("In Progress", typeof(string)); |             //dtTime.Columns.Add("Finished", typeof(string)); | ||||||
|             dtTime.Columns.Add("Not Start", typeof(string)); |             //dtTime.Columns.Add("In Progress", typeof(string)); | ||||||
|  |             //dtTime.Columns.Add("Not Start", typeof(string)); | ||||||
| 
 | 
 | ||||||
|             var systemBol = false; |             var systemBol = false; | ||||||
|             for (var i = sTime; i <= eTime; i=returnDay(i)) |             for (var i = sTime; i <= eTime; i=returnDay(i)) | ||||||
|  | @ -171,20 +172,21 @@ namespace FineUIPro.Web.Transfer.Chart | ||||||
|                     //查询当前日期每个testpackage的数量 |                     //查询当前日期每个testpackage的数量 | ||||||
|                     var systemSumCount = systemListbyDate.Where(x => x.TestPackage == item).ToList().Count; |                     var systemSumCount = systemListbyDate.Where(x => x.TestPackage == item).ToList().Count; | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|                     //子系统中完成的数量 |                     //子系统中完成的数量 | ||||||
|                     var subSystemSumCount = systemListbyDate.Where(x => x.TestPackage == item && |                     var subSystemSumCount = systemListbyDate.Where(x => x.TestPackage == item && | ||||||
|                     x.Status.ToLower() == "finished").ToList().Count; |                     x.Status.ToLower() == "finished").ToList().Count; | ||||||
| 
 | 
 | ||||||
|                     //子系统中没完成的情况 |                     ////子系统中没完成的情况 | ||||||
|                     var subSystemSumNotStartCount = systemListbyDate.Where(x => x.TestPackage == item && |                     //var subSystemSumNotStartCount = systemListbyDate.Where(x => x.TestPackage == item && | ||||||
|                     (x.Status.ToLower() == "not start"|| x.Status=="" || x.Status==null )).ToList().Count; |                     //(x.Status.ToLower() == "not start"|| x.Status=="" || x.Status==null )).ToList().Count; | ||||||
| 
 | 
 | ||||||
|                     //如果总数量等于完成的数量,完成量+1 |                     //如果总数量等于完成的数量,完成量+1 | ||||||
|                     if (systemSumCount == subSystemSumCount) |                     if (systemSumCount == subSystemSumCount) | ||||||
|                     { |                     { | ||||||
|                         //如果都是完成,需要最后 12表 test packge 必须是Finished才能是完成 |                         //如果都是完成,需要最后 12表 test packge 必须是Finished才能是完成 | ||||||
|                         var punchlistFromList= Funs.DB.Transfer_PunchlistFrom.Where(x=>x.ProjectId==ProjectId |                         var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId | ||||||
|                         && x.Test_Package==item |                          && x.Test_Package == item | ||||||
|                         ).ToList(); |                         ).ToList(); | ||||||
| 
 | 
 | ||||||
|                         ////如果按年月 |                         ////如果按年月 | ||||||
|  | @ -205,26 +207,30 @@ namespace FineUIPro.Web.Transfer.Chart | ||||||
|                             { |                             { | ||||||
|                                 finishedCount += 1; |                                 finishedCount += 1; | ||||||
|                             } |                             } | ||||||
|                             else { |                             //else | ||||||
|                                 inProgress += 1; |                             //{ | ||||||
|  |                             //    inProgress += 1; | ||||||
|  |                             //} | ||||||
|                         } |                         } | ||||||
|                         } |                         else | ||||||
|                         else { |                         { | ||||||
|                             finishedCount += 1; |                             finishedCount += 1; | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                     //如果总数量等于not start,未开始量+1 |                     ////如果总数量等于not start,未开始量+1 | ||||||
|                     else if (systemSumCount== subSystemSumNotStartCount) |                     //else if (systemSumCount == subSystemSumNotStartCount) | ||||||
|                     { |                     //{ | ||||||
|                         notStart += 1; |                     //    notStart += 1; | ||||||
|  |                     //} | ||||||
|  |                     //else | ||||||
|  |                     //{ | ||||||
|  |                     //    inProgress += 1; | ||||||
|  |                     //} | ||||||
|                 } |                 } | ||||||
|                     else {  |                 //rowTime["Finished"] = finishedCount; | ||||||
|                         inProgress += 1; |                 //rowTime["In Progress"] = inProgress; | ||||||
|                     } |                 //rowTime["Not Start"] = notStart; | ||||||
|                 } |                 rowTime["Plan Finished"] = finishedCount; | ||||||
|                 rowTime["Finished"] = finishedCount; |  | ||||||
|                 rowTime["In Progress"] = inProgress; |  | ||||||
|                 rowTime["Not Start"] = notStart; |  | ||||||
|                 dtTime.Rows.Add(rowTime); |                 dtTime.Rows.Add(rowTime); | ||||||
| 
 | 
 | ||||||
|             } |             } | ||||||
|  | @ -356,33 +362,29 @@ namespace FineUIPro.Web.Transfer.Chart | ||||||
|                         eTime = Convert.ToDateTime(txtEndTime1.Text); |                         eTime = Convert.ToDateTime(txtEndTime1.Text); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|                 //var sTime = DateTime.Now.AddDays(-7); |  | ||||||
|                 //var eTime = DateTime.Now; ; |  | ||||||
|                 |                 | ||||||
|                 ////如果没有填写日期,则是七天内的 |  | ||||||
|                 //if (!string.IsNullOrEmpty(txtStarTime.Text) && !string.IsNullOrEmpty(txtEndTime.Text)) |  | ||||||
|                 //{ |  | ||||||
|                 //    sTime = Convert.ToDateTime(txtStarTime.Text); |  | ||||||
|                 //    eTime = Convert.ToDateTime(txtEndTime.Text); |  | ||||||
| 
 |  | ||||||
|                 //} |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|                 DataTable dtTime = new DataTable(); |                 DataTable dtTime = new DataTable(); | ||||||
|  |                 //dtTime.Columns.Add("日期", typeof(string)); | ||||||
|  |                 //dtTime.Columns.Add("Finished", typeof(string)); | ||||||
|  |                 //dtTime.Columns.Add("In Progress", typeof(string)); | ||||||
|  |                 //dtTime.Columns.Add("Not Start", typeof(string)); | ||||||
|  | 
 | ||||||
|                 dtTime.Columns.Add("日期", typeof(string)); |                 dtTime.Columns.Add("日期", typeof(string)); | ||||||
|                 dtTime.Columns.Add("Finished", typeof(string)); |                 dtTime.Columns.Add("Actual Finished", typeof(string)); | ||||||
|                 dtTime.Columns.Add("In Progress", typeof(string)); |                 dtTime.Columns.Add("Plan Finished", typeof(string)); | ||||||
|                 dtTime.Columns.Add("Not Start", typeof(string)); |  | ||||||
| 
 | 
 | ||||||
|                 var systemBol = false; |                 var systemBol = false; | ||||||
|                 for (var i = sTime; i <= eTime; i = returnDay(i)) |                 for (var i = sTime; i <= eTime; i = returnDay(i)) | ||||||
|                 { |                 { | ||||||
|                     var finishedCount = 0; |                     var AfinishedCount = 0;//实际完成数量 | ||||||
|                     var inProgress = 0; |                     var PfinishedCount = 0;//计划完成数量 | ||||||
|                     var notStart = 0; |  | ||||||
|                     DataRow rowTime = dtTime.NewRow(); |  | ||||||
|                     Model.SpTDesktopItem newspItem = new Model.SpTDesktopItem(); |  | ||||||
| 
 | 
 | ||||||
|  |                     //var finishedCount = 0; | ||||||
|  |                     //var inProgress = 0; | ||||||
|  |                     //var notStart = 0; | ||||||
|  |                     DataRow rowTime = dtTime.NewRow(); | ||||||
|                     //按年月 |                     //按年月 | ||||||
|                     if (drpdateType.SelectedValue == "0") |                     if (drpdateType.SelectedValue == "0") | ||||||
|                     { |                     { | ||||||
|  | @ -423,9 +425,9 @@ namespace FineUIPro.Web.Transfer.Chart | ||||||
|                         var subSystemSumCount = systemListbyDate.Where(x => x.TestPackage == item && |                         var subSystemSumCount = systemListbyDate.Where(x => x.TestPackage == item && | ||||||
|                         x.Status.ToLower() == "finished").ToList().Count; |                         x.Status.ToLower() == "finished").ToList().Count; | ||||||
| 
 | 
 | ||||||
|                         //子系统中没完成的情况 |                         ////子系统中没完成的情况 | ||||||
|                         var subSystemSumNotStartCount = systemListbyDate.Where(x => x.TestPackage == item && |                         //var subSystemSumNotStartCount = systemListbyDate.Where(x => x.TestPackage == item && | ||||||
|                         (x.Status.ToLower() == "not start" || x.Status == "" || x.Status == null)).ToList().Count; |                         //(x.Status.ToLower() == "not start" || x.Status == "" || x.Status == null)).ToList().Count; | ||||||
| 
 | 
 | ||||||
|                         //如果总数量等于完成的数量,完成量+1 |                         //如果总数量等于完成的数量,完成量+1 | ||||||
|                         if (systemSumCount == subSystemSumCount) |                         if (systemSumCount == subSystemSumCount) | ||||||
|  | @ -446,31 +448,71 @@ namespace FineUIPro.Web.Transfer.Chart | ||||||
|                                 //如果完成的数量等于总得数量,则是完成 |                                 //如果完成的数量等于总得数量,则是完成 | ||||||
|                                 if (punchlistFromFinshCount == punchlistFromList.Count) |                                 if (punchlistFromFinshCount == punchlistFromList.Count) | ||||||
|                                 { |                                 { | ||||||
|                                     finishedCount += 1; |                                     PfinishedCount += 1; | ||||||
|  |                                 } | ||||||
|  |                                 //else | ||||||
|  |                                 //{ | ||||||
|  |                                 //    inProgress += 1; | ||||||
|  |                                 //} | ||||||
|                             } |                             } | ||||||
|                             else |                             else | ||||||
|                             { |                             { | ||||||
|                                     inProgress += 1; |                                 PfinishedCount += 1; | ||||||
|  |                             } | ||||||
|  |                         } | ||||||
|  |                         ////如果总数量等于not start,未开始量+1 | ||||||
|  |                         //else if (systemSumCount == subSystemSumNotStartCount) | ||||||
|  |                         //{ | ||||||
|  |                         //    notStart += 1; | ||||||
|  |                         //} | ||||||
|  |                         //else | ||||||
|  |                         //{ | ||||||
|  |                         //    inProgress += 1; | ||||||
|  |                         //} | ||||||
|  |                     } | ||||||
|  |                     rowTime["Plan Finished"] = PfinishedCount; | ||||||
|  | 
 | ||||||
|  |                     //实际的完成数量 | ||||||
|  |                     systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId | ||||||
|  |                                  && x.ADate >= Convert.ToDateTime(rowTime["日期"]) | ||||||
|  |                                  && x.ADate < Convert.ToDateTime(rowTime["日期"]).AddDays(1) | ||||||
|  |                                  && x.Status.ToLower() == "finished").ToList(); | ||||||
|  |                     //如果按年月 | ||||||
|  |                     if (drpdateType.SelectedValue == "0") | ||||||
|  |                     { | ||||||
|  |                         systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId && x.SystemName == SystemName | ||||||
|  |                                         && x.ADate >= Convert.ToDateTime(rowTime["日期"]) | ||||||
|  |                                         && x.ADate < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)).ToList(); | ||||||
|  |                     } | ||||||
|  |                     //查询TestPackage的总数量,状态是完成的。 | ||||||
|  |                     testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct(); | ||||||
|  |                     foreach (var item in testpackageList) | ||||||
|  |                     { | ||||||
|  |                         //查询第12个表的数量 | ||||||
|  |                         var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId | ||||||
|  |                          && x.Test_Package == item | ||||||
|  |                         ).ToList(); | ||||||
|  |                         //如果查到 | ||||||
|  |                         if (punchlistFromList.Count > 0) | ||||||
|  |                         { | ||||||
|  |                             //12表当前日期完成的数量 | ||||||
|  |                             var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count(); | ||||||
|  |                             //如果完成的数量等于总得数量,则是完成 | ||||||
|  |                             if (punchlistFromFinshCount == punchlistFromList.Count) | ||||||
|  |                             { | ||||||
|  |                                 AfinishedCount += 1; | ||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
|                         else |                         else | ||||||
|                         { |                         { | ||||||
|                                 finishedCount += 1; |                             AfinishedCount += 1; | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                         //如果总数量等于not start,未开始量+1 |                     rowTime["Actual Finished"] = AfinishedCount; | ||||||
|                         else if (systemSumCount == subSystemSumNotStartCount) | 
 | ||||||
|                         { |                     //rowTime["Finished"] = finishedCount; | ||||||
|                             notStart += 1; |                     //rowTime["In Progress"] = inProgress; | ||||||
|                         } |                     //rowTime["Not Start"] = notStart; | ||||||
|                         else |  | ||||||
|                         { |  | ||||||
|                             inProgress += 1; |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                     rowTime["Finished"] = finishedCount; |  | ||||||
|                     rowTime["In Progress"] = inProgress; |  | ||||||
|                     rowTime["Not Start"] = notStart; |  | ||||||
|                     dtTime.Rows.Add(rowTime); |                     dtTime.Rows.Add(rowTime); | ||||||
| 
 | 
 | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue