This commit is contained in:
李鹏飞 2023-11-21 15:44:24 +08:00
commit 5e5ad08320
1 changed files with 34 additions and 25 deletions

View File

@ -1078,6 +1078,8 @@ namespace FineUIPro.Web.CQMS.Performance
//根据gid获取CQMS_Performance_Child2 施工进度管理的子表数据大于一条就要多增加数据到List中 //根据gid获取CQMS_Performance_Child2 施工进度管理的子表数据大于一条就要多增加数据到List中
var ChildSgjdCount = db.CQMS_Performance_Child2.Where(x => x.NowWeek == 1 && x.PerformanceGid == PerformanceGid var ChildSgjdCount = db.CQMS_Performance_Child2.Where(x => x.NowWeek == 1 && x.PerformanceGid == PerformanceGid
&& x.Performance_ChildGid1 == OneGid).ToList().Count(); && x.Performance_ChildGid1 == OneGid).ToList().Count();
for (int i = 0; i < ChildSgjdCount - 1; i++)
{
var addList = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 1) var addList = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 1)
.Select(x => new GridModels .Select(x => new GridModels
{ {
@ -1090,20 +1092,26 @@ namespace FineUIPro.Web.CQMS.Performance
MonthTarget = x.MonthTarget, MonthTarget = x.MonthTarget,
SortIndex = x.SortIndex SortIndex = x.SortIndex
}).ToList(); }).ToList();
if (ChildSgjdCount == 2)
{ addList[0].Performance_ChildGid1 = addList[0].Performance_ChildGid1 + "one" + i.ToString();
addList[0].Performance_ChildGid1 = addList[0].Performance_ChildGid1 + "one"; listChild1.InsertRange(i + 1, addList);
listChild1.InsertRange(1, addList);
}
else if (ChildSgjdCount == 3)
{
var pgid = addList[0].Performance_ChildGid1;
addList[0].Performance_ChildGid1 = pgid + "one";
listChild1.InsertRange(1, addList);
addList[0].Performance_ChildGid1 = pgid + "two";
listChild1.InsertRange(2, addList);
} }
//if (ChildSgjdCount == 2)
//{
// addList[0].Performance_ChildGid1 = addList[0].Performance_ChildGid1 + "one";
// listChild1.InsertRange(1, addList);
//}
//else if (ChildSgjdCount == 3)
//{
// var pgid = addList[0].Performance_ChildGid1;
// addList[0].Performance_ChildGid1 = pgid + "one";
// listChild1.InsertRange(1, addList);
// addList[0].Performance_ChildGid1 = pgid + "two";
// listChild1.InsertRange(2, addList);
//}
//循环list给每周任务、工程量、资源需求计划、本周工作任务完成情况 ,每日工作计划、完成情况赋值 //循环list给每周任务、工程量、资源需求计划、本周工作任务完成情况 ,每日工作计划、完成情况赋值
//获取周数 //获取周数
var NowDate = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()); var NowDate = Convert.ToDateTime(drpCompileDateMonth.Text.Trim());
@ -1129,12 +1137,13 @@ namespace FineUIPro.Web.CQMS.Performance
var chilGid = listChild1[i].Performance_ChildGid1; var chilGid = listChild1[i].Performance_ChildGid1;
if (chilGid.IndexOf("one") > -1 || chilGid.IndexOf("two") > -1) if (chilGid.IndexOf("one") > -1 || chilGid.IndexOf("two") > -1)
{ {
chilGid = chilGid.Substring(0, chilGid.Length - 3); chilGid = chilGid.Substring(0, chilGid.Length - 4);
} }
//根据周数获取数据 //根据周数获取数据
var Child2ListNew = db.CQMS_Performance_Child2.FirstOrDefault(x => x.PerformanceGid == listChild1[i].PerformanceGid var Child2ListNew = db.CQMS_Performance_Child2.FirstOrDefault(x => x.PerformanceGid == listChild1[i].PerformanceGid
&& x.Performance_ChildGid1 == chilGid && x.NowWeek == (y + 1) && x.SortIndex == (i + 1)); && x.Performance_ChildGid1 == chilGid && x.NowWeek == (y + 1) && x.SortIndex == (i + 1));
//将list中的周数数据插入 //将list中的周数数据插入
if (Child2ListNew == null) if (Child2ListNew == null)
{ {