public IList <ScheduleKPI> GetByKpi([FromForm] int eid, [FromForm] KpiPlan planId, [FromForm] DateTime startDate, [FromForm] DateTime endDate) { //先根据条件获取所有日程 IList <Schedule> list = _scheduleBusiness.GetByKpi(eid, planId, startDate, endDate); //封装新集合 IList <ScheduleKPI> newList = new List <ScheduleKPI>(); foreach (Schedule item in list) { ScheduleKPI sm = new ScheduleKPI(); sm.Id = item.Id; sm.Title = item.Title; sm.BeginTime = item.BeginTime; sm.EndTime = item.EndTime; sm.KpiManageRecordId = item.KpiManageRecordId; sm.KpiManageRecordName = item.KpiManageRecordName; //完成了的集合 IList <ScheduleComplete> cmp = _scheduleCompleteBusiness.Get(item.Id); //执行人集合 string exestring = item.Executors.Substring(1); exestring = exestring.Substring(0, exestring.Length - 1); string[] exes = exestring.Split(","); //如果完成数等于执行人数 if (cmp.Count >= exes.Length) { sm.Completion = "已完成"; } else { sm.Completion = "未完成"; } newList.Add(sm); } return(newList); }
public IList <ScheduleComplete> Get(int scheId) { return(_scheduleCompleteBusiness.Get(scheId)); }