Пример #1
0
        /// <summary>
        /// 获取需要情况的任务库班组id
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        private void jobGroup(List <WorkGroupSetEntity> group)
        {
            WorkmeetingBLL meet     = new WorkmeetingBLL();
            var            deptList = new List <string>();
            var            newStr   = string.Join(",", group.OrderBy(x => x.departmentid));

            foreach (var newGroup in group)
            {
                //获取之前绑定
                var oldGroup = GetWorkOrderGroup(newGroup.departmentid);
                var oldStr   = string.Join(",", oldGroup.OrderBy(x => x.departmentid));
                //如果没有差别不需要清理任务库
                if (newStr == oldStr)
                {
                    break;
                }
                foreach (var old in oldGroup)
                {
                    if (!deptList.Contains(old.departmentid))
                    {
                        deptList.Add(old.departmentid);
                    }
                }
                if (!deptList.Contains(newGroup.departmentid))
                {
                    deptList.Add(newGroup.departmentid);
                }
            }
            //清理绑定班组数据库

            meet.DeleteJobTemplateByDept(deptList);
        }