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

@ -1077,33 +1077,41 @@ 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();
var addList = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 1) for (int i = 0; i < ChildSgjdCount - 1; i++)
.Select(x => new GridModels
{
Performance_ChildGid1 = x.Performance_ChildGid1,
PerformanceGid = x.PerformanceGid,
PType = x.PType,
EvaScore = x.EvaScore,
Itemize = x.Itemize,
WorkArea = x.WorkArea,
MonthTarget = x.MonthTarget,
SortIndex = x.SortIndex
}).ToList();
if (ChildSgjdCount == 2)
{ {
addList[0].Performance_ChildGid1 = addList[0].Performance_ChildGid1 + "one"; var addList = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 1)
listChild1.InsertRange(1, addList); .Select(x => new GridModels
} {
else if (ChildSgjdCount == 3) Performance_ChildGid1 = x.Performance_ChildGid1,
{ PerformanceGid = x.PerformanceGid,
var pgid = addList[0].Performance_ChildGid1; PType = x.PType,
addList[0].Performance_ChildGid1 = pgid + "one"; EvaScore = x.EvaScore,
listChild1.InsertRange(1, addList); Itemize = x.Itemize,
addList[0].Performance_ChildGid1 = pgid + "two"; WorkArea = x.WorkArea,
listChild1.InsertRange(2, addList); MonthTarget = x.MonthTarget,
SortIndex = x.SortIndex
}).ToList();
addList[0].Performance_ChildGid1 = addList[0].Performance_ChildGid1 + "one" + i.ToString();
listChild1.InsertRange(i + 1, 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)
{ {