public async Task <string> Handle()
        {
            //方庄新概念
            //var productTypeId = 3;
            //var branchId = 101005000;
            //var classPerLevel= 42;
            //var defaultSA = "jennifer_jy";
            //var defaultFT = "muham_mjm";
            //var defaultLT = "doris_zq";
            //var currentDate = Convert.ToDateTime("2020-11-01");

            //方庄进阶
            var productTypeId = 2;
            var branchId      = 101005000;
            var classPerLevel = 48;
            var defaultSA     = "jennifer_jy";
            var defaultFT     = "muham_mjm";
            var defaultLT     = "doris_zq"; //基本开班的班级都存在中教信息
            var currentDate   = Convert.ToDateTime("2020-12-04");


            var beginDate = Convert.ToDateTime("2000-01-01");
            var endDate   = Convert.ToDateTime("2100-01-01");
            var classStudentStatus_Normal = "0,1";
            var classStudentStatus_Stop   = "4";
            var classStatus_pre           = 1;
            var classStatus_pro           = 2;

            //预售班范围
            var preClasses = await _classDomainService.GetClassCourseRange(productTypeId, branchId, classStatus_pre, currentDate, endDate);

            ////在读班范围
            var proClasses = await _classDomainService.GetClassCourseRange(productTypeId, branchId, classStatus_pro, beginDate, currentDate);

            ////导入预售班级
            var result1 = await _classStudentApplicationService.SendClassToMtsAsync(productTypeId, branchId, preClasses, classPerLevel, defaultSA, defaultFT, defaultLT);

            //导入已开班班级
            var result2 = await _classStudentApplicationService.SendClassToMtsAsync(productTypeId, branchId, proClasses, classPerLevel, defaultSA, defaultFT, defaultLT);

            ////导入预售班学生
            var result3 = await _classStudentApplicationService.SendStudentToMtsAsync(productTypeId, branchId, preClasses, classPerLevel, classStatus_pre, classStudentStatus_Normal);

            ////导入已开班学生(入班)
            var result4 = await _classStudentApplicationService.SendStudentToMtsAsync(productTypeId, branchId, proClasses, classPerLevel, classStatus_pro, classStudentStatus_Normal, true);

            ////导入已开班学生(不入班)
            var result5 = await _classStudentApplicationService.SendStudentToMtsAsync(productTypeId, branchId, proClasses, classPerLevel, classStatus_pro, classStudentStatus_Stop, false);

            ////设置班级进度
            var result6 = await _classStudentApplicationService.SetClassProcessAsync(productTypeId, branchId, proClasses, classPerLevel);

            return($"PreClass:{result1}\r\nPostClass:{result2}\r\nPreStudent:{result3}\r\nPostClassIn:{result4}\r\nPostClassOut:{result5}\r\nSetClass:{result6}\r\n");
        }
Beispiel #2
0
        /// <summary>
        /// 获取班级筛选范围
        /// </summary>
        /// <param name="productType"></param>
        /// <param name="branchId"></param>
        /// <param name="clasStatus"></param>
        /// <param name="beginTimeDate"></param>
        /// <param name="endTimeDate"></param>
        /// <returns></returns>
        public async Task <dynamic> GetClassRange(int productType, int branchId, int clasStatus, DateTime?beginTimeDate, DateTime?endTimeDate)
        {
            var targetClasses = await _classDomainService.GetClassCourseRange(productType, branchId, clasStatus, beginTimeDate, endTimeDate);

            return(targetClasses.Select(e => new { e.Clas_Name, e.Product.Prod_Name, e.Clas_Code, LT = e.LT?.User_Logon, FT = e.FT?.User_Logon, SA = e.SA?.User_Logon }).ToList());
        }