Пример #1
0
        /// <summary>
        /// 作者:Ark
        /// 时间:2014.07.15
        /// 描述:学员投诉确认结果
        /// ---------------------------
        /// 时间:2014.07.28
        /// 描述:添加两参数
        /// ---------------------------
        /// 时间:2014.08.08
        /// 描述:还原为3个参数
        /// </summary>
        /// <param name="caseId">Eme主键</param>
        /// <param name="status">投诉结果(通过/不通过)</param>
        /// <param name="remark">回复内容</param>
        /// <returns></returns>
        public ResultTiper ConfirmFeedback(string caseId, string status, string remark)
        {
            var ret = new ResultTiper { Status = 100 };

            try
            {
                var oaForEmeCilent = new ReceiveEMEPortTypeClient();
                // 返回 “成功/失败”
                var result = oaForEmeCilent.studentsComplainReceive(caseId, status, remark);
                oaForEmeCilent.Close();
                //ret.ReturnValue = result; // WCF不能传输ArrayOfString 所以要注释

                if (result[0] != "成功")
                {
                    ret.Status = 101;
                    ret.Msg = result[1];
                }
            }
            catch (Exception ex)
            {
                ret.Status = 102;
                ret.Msg = "操作失败,调用OA服务异常";
            }

            return ret;
        }
Пример #2
0
        /// <summary>
        /// 作者:Ark
        /// 时间:2014.08.09
        /// 描述:同步SA
        /// </summary>
        /// <param name="contractId">Crm合同编号</param>
        /// <param name="sa">SA的登录帐号User表的UserName</param>
        /// <returns></returns>
        public ResultTiper SyncSa(int contractId, string sa)
        {
            ResultTiper ret = new ResultTiper { Status = 100 };

            try
            {
                EMEToCRMAPIClient client = new EMEToCRMAPIClient();
                bool result = client.ChangeSA(contractId, sa);
                client.Close();
                ret.ReturnValue = result;

                if (!result)
                {
                    ret.Status = 101;
                    ret.Msg = "操作失败,Crm返回";
                }
            }
            catch (Exception ex)
            {
                ret.Status = 102;
                ret.Msg = "操作失败,调用Crm接口服务异常";
            }

            return ret;
        }
Пример #3
0
        /// <summary>
        /// 作者:Ark
        /// 时间:2014.07.15
        /// 描述:创建反馈流程 Eme触发OA流程
        /// </summary>
        /// <param name="feedbackId">反馈编号</param>
        /// <param name="studentId">学员编号</param>
        /// <returns></returns>
        public ResultTiper CreateFeedBack(int feedbackId, int studentId)
        {
            #region 定义dataXml需要的变量

            string studentName = string.Empty;
            // 性别男、女、未知(默认未知)
            string sex = "未知";
            string mobile = string.Empty;
            // 合同类型
            string contractType = string.Empty;
            // 合同产品
            string productName = string.Empty;
            // 购买级别
            string levels = string.Empty;
            // 当前级别
            string currLevels = string.Empty;
            // 中心编号
            string branchId = string.Empty;
            // 中心名称
            string branchName = string.Empty;
            // 学员SA
            string sa = string.Empty;
            // 学员CC
            string cc = string.Empty;
            // 反馈附件(URL,多个时由‘|’分隔开)
            string attachmentUrl = string.Empty;
            Feedback feedback = null;

            #endregion

            ResultTiper ret = new ResultTiper { Status = 100 };

            try
            {
                #region 读取dataXml数据

                feedback = FeedbackBLL.GetFeedbackById(feedbackId);
                Student student = StudentBLL.GetStudentById(studentId);

                if (null == feedback || null == student)
                {
                    ret.Status = 105;
                    ret.Msg = "反馈信息或学员信息这空";
                    return ret;
                }

                foreach (UserInfo uinfo in student.User.UserInfo.Where(p => p.Status == ConvertEnum.StatusTypeForActive))
                {
                    studentName = string.Format("{0} {1}", uinfo.CName, uinfo.EName);
                    mobile = uinfo.Mobile;

                    if (uinfo.Sex.HasValue)
                    {
                        sex = BaseEnum.EmeEnum<SexType>.GetCnameByValue(uinfo.Sex.Value);
                    }
                }
                foreach (ContractType ctype in StudentBLL.GetContractTypeListByStudentId(studentId))
                {
                    contractType += ctype.CName + ";";
                }
                foreach (Product product in ProductBLL.GetProductListByStudentId(studentId))
                {
                    productName += product.EName + ";";
                }
                foreach (ProductLevel level in ProductBLL.GetProductLevelListByStudentId(studentId))
                {
                    levels += level.EName + ";";
                }
                foreach (ProductLevel level in ProductBLL.GetCurrProductLevelListByStudentId(studentId))
                {
                    currLevels += level.EName + ";";
                }
                foreach (var branch in student.User.UserBranch.Where(p => p.IsMain && p.Status == ConvertEnum.StatusTypeForActive))
                {
                    branchId = branch.BranchId.ToString();
                    branchName = branch.Branch.CName;
                }
                if (student.SA.HasValue)
                {
                    var saUserInfo = UserBLL.GetUserInfoByUserId(student.SA.Value);

                    if (null != saUserInfo)
                        sa = string.Format("{0} {1}", saUserInfo.CName, saUserInfo.EName);
                }
                if (student.SA.HasValue)
                {
                    var ccUserInfo = UserBLL.GetUserInfoByUserId(student.CC.Value);

                    if(null != ccUserInfo)
                        cc = string.Format("{0} {1}", ccUserInfo.CName, ccUserInfo.EName);
                }
                foreach (var attachment in feedback.FeedbackAttachment)
                {
                    attachmentUrl += WebCommon.Global.GetFileUrl(AttachmentType.Feedback, attachment.FileCode) + "|";
                }

                #endregion
            }
            catch (Exception ex)
            {
                ret.Status = 104;
                ret.Msg = "dataXml读取数据异常";
                return ret;
            }

            #region 拼接参数dataXml(表单数据)

            StringBuilder dataXml = new StringBuilder();
            dataXml.Append(@"<root><data><main>");
            dataXml.AppendFormat(@"<FeedbackId>{0}</FeedbackId>", feedbackId);
            dataXml.AppendFormat(@"<StudentId>{0}</StudentId>", studentId);
            dataXml.AppendFormat(@"<StudentName>{0}</StudentName>", studentName);
            dataXml.AppendFormat(@"<ContractType>{0}</ContractType>", contractType);
            dataXml.AppendFormat(@"<ProductName>{0}</ProductName>", productName);
            dataXml.AppendFormat(@"<Levels>{0}</Levels>", levels);
            dataXml.AppendFormat(@"<CurrLevel>{0}</CurrLevel>", currLevels);
            dataXml.AppendFormat(@"<BranchId>{0}</BranchId>", branchId);
            dataXml.AppendFormat(@"<BranchName>{0}</BranchName>", branchName);
            dataXml.AppendFormat(@"<Sex>{0}</Sex>", sex);
            dataXml.AppendFormat(@"<SA>{0}</SA>", sa);
            dataXml.AppendFormat(@"<CC>{0}</CC>", cc);
            dataXml.AppendFormat(@"<Mobile>{0}</Mobile>", mobile);
            dataXml.AppendFormat(@"<FeedbackDateTime>{0}</FeedbackDateTime>", feedback.CreateTime);
            dataXml.AppendFormat(@"<FeedbackContent>{0}</FeedbackContent>", feedback.FContent);
            dataXml.AppendFormat(@"<FeedbackAttachment>{0}</FeedbackAttachment>", attachmentUrl);
            dataXml.Append(@"</main></data></root>");

            #endregion

            #region 调用OA服务,添加反馈信息

            try
            {
                var oaForEmeCilent = new doWorkflowRequestPortTypeClient();
                string result = oaForEmeCilent.doWorkflowRequest(
                    ConfigHelper.GetAppSettingValue("WorkflowId"),                 // WorkflowId:流程ID
                    "",                     // RequestId:流程请求ID,此属性为空或检测到流程请求已归档、强制归档则重新发起新的流程
                    "0",                    // RequestLevel:紧急程度:	0正常,1重要,2紧急,默认:0正常
                    "",                     // RequestTitle:流程标题,如果值为空或空串,系统自动按照默认标题命名法“流程标题-发起人-日期”
                    true,                  // IsNextflow:流程是否自动提交至下一个节点,默认为false不自动提交  --2014-08-15因为用代理,所以必须自动
                    dataXml.ToString(),     // DataXML:异构系统传到流程表单的数据,需要符合一定格式规范,xml标签名可随意
                    "sysadmin",                     // OperatorId:操作人工号,需要对应OA工号,要求OA工号不能有重用
                    ""                      // Remark:审批意见
                   );
                oaForEmeCilent.Close();
                ret.ReturnValue = result;

                if (!string.IsNullOrEmpty(result))
                {
                    // OA服务返回值xml解析
                    XElement root = XElement.Parse(result);
                    string success = root.Element("success").Value.ToLower();
                    string msg = root.Element("msg").Value;

                    if ("true" != success)
                    {
                        ret.Status = 101;

                        if (!string.IsNullOrEmpty(msg))
                        {
                            ret.Msg = msg;
                        }
                        else
                        {
                            string exceptionMsg = root.Element("exceptionMsg").Value;
                            ret.Msg = exceptionMsg;
                        }
                    }
                }
                else
                {
                    ret.Status = 102;
                    ret.Msg = "调用OA服务返回空值";
                }

            }
            catch (Exception ex)
            {
                ret.Status = 103;
                ret.Msg = "操作失败,调用OA服务异常";
            }

            #endregion

            return ret;
            /* OA服务返回值xml格式
             <ResultInfo>
              <success>true or false</success>
              <workflowId></workflowId>
              <workflowCode></workflowCode>
              <requestId></requestId>
              <requestHandleMode></requestHandleMode>
              <executeHandleMode></executeHandleMode>
              <msg></msg>
              <exceptionMsg></exceptionMsg>
            </ResultInfo>
             */
        }
Пример #4
0
        /// <summary>
        /// 作者:Ark
        /// 时间:2014.08.30
        /// 描述:更新Crm学员信息
        /// </summary>
        /// <param name="crmUser"></param>
        /// <param name="sex"></param>
        /// <param name="paramError"></param>
        /// <param name="noCrossCenterList"></param>
        /// <param name="specialAreaList"></param>
        /// <returns></returns>
        public static ResultTiper UpdateUserForCrm(UserModel crmUser, int sex, string paramError, List<int> noCrossCenterList, List<int> specialAreaList)
        {
            var result = new ResultTiper { Status = 100 };
            // 用户名
            var userName = crmUser.UserName;
            // 用户类型学员
            var userType = ConvertEnum.UserTypeForStudent;
            // 状态正常
            var activeStatus = ConvertEnum.StatusTypeForActive;
            var updateBy = -122;

            using (var edb = new EmeEntities())
            {
                try
                {
                    var emeUser = edb.User.FirstOrDefault(u => u.UserName.Equals(userName, StringComparison.CurrentCultureIgnoreCase));
                    // 用户不存在
                    if (null == emeUser)
                    {
                        result.Status = 101;
                        result.Msg = paramError + ":未找到改用户,更新失败";
                        return result;
                    }

                    var branchId = edb.Branch.Where(b => b.DataCenterId == crmUser.BranchId && b.Status == activeStatus).Select(b => b.Id).FirstOrDefault();

                    // 中心不存在
                    if (branchId < 1)
                    {
                        result.Status = 101;
                        result.Msg = paramError + ":没有找到对应的中心,中心错误";
                        return result;
                    }

                    var userId = emeUser.Id;
                    emeUser.Email = crmUser.Email;
                    emeUser.Mobile = crmUser.Mobile;
                    emeUser.UpdateBy = updateBy;
                    emeUser.UpdateTime = DateTime.Now;
                    emeUser.Status = activeStatus;
                    emeUser.IsSync = false;
                    edb.Entry(emeUser).State = EntityState.Modified;

                    var emeUserInfo = edb.UserInfo.FirstOrDefault(u => u.UserId == userId);

                    if (null != emeUserInfo)
                    {
                        emeUserInfo.CName = crmUser.Cname;
                        //emeUserInfo.EName = crmUser.Ename;    //Ark 2014-08-19 不同步英文名
                        //emeUserInfo.Mobile = crmUser.Mobile;  //beta 2015.04.07 同步不修改学员手机号码
                        emeUserInfo.Email = crmUser.Email;
                        emeUserInfo.Birthday = crmUser.Birthday;
                        emeUserInfo.Sex = sex;
                        emeUserInfo.Status = activeStatus;
                        emeUserInfo.UpdateBy = updateBy;
                        emeUserInfo.UpdateTime = DateTime.Now;
                        emeUserInfo.Address = crmUser.Address;
                        edb.Entry(emeUserInfo).State = EntityState.Modified;
                    }
                    else
                    {
                        emeUserInfo = new UserInfo()
                        {
                            UserId = emeUser.Id,
                            CName = crmUser.Cname,
                            EName = crmUser.Ename,
                            Mobile = crmUser.Mobile,
                            Sex = sex,
                            Email = crmUser.Email,
                            Birthday = crmUser.Birthday,
                            Status = activeStatus,
                            CreateBy = updateBy,
                            CreateTime = DateTime.Now,
                            Address = crmUser.Address
                        };

                        edb.Entry(emeUserInfo).State = EntityState.Added;
                    }

                    var emeUserBranch = edb.UserBranch.FirstOrDefault(p => p.UserId == userId && p.Status == activeStatus && p.IsMain);

                    if (null != emeUserBranch)
                    {
                        // 所属中心修改,修改对应的跨中心
                        if (emeUserBranch.BranchId != branchId)
                        {
                            #region 跨中心订课 2014-11-1 raymond 取消

                            //// 原所属中心在不允许跨中心订课中心中不存在
                            //if (!noCrossCenterList.Contains(emeUserBranch.BranchId))
                            //{
                            //    // 取非所属中心
                            //    var otherBranchList = edb.UserBranch.Where(b => b.UserId == userId && b.BranchId != emeUserBranch.BranchId).ToList();

                            //    foreach (var other in otherBranchList)
                            //    {
                            //        other.Status = ConvertEnum.StatusTypeForDelete;
                            //        emeUserBranch.UpdateBy = updateBy;
                            //        emeUserBranch.UpdateTime = DateTime.Now;

                            //        edb.Entry(emeUserBranch).State = EntityState.Modified;
                            //    }
                            //}

                            //// 新所属中心在不允许跨中心订课中心中不存在
                            //if (!noCrossCenterList.Contains(branchId))
                            //{
                            //    // 获取区域BranchId
                            //    var areaBranchId = edb.Branch.Where(b => b.Id == emeUserBranch.BranchId).Select(b => b.ParentId).FirstOrDefault();

                            //    // 区域存在
                            //    if (areaBranchId > 0)
                            //    {
                            //        List<int> branchIdList = null;

                            //        // 获取区域下的所有中心(特殊区域)
                            //        if (specialAreaList.Contains(areaBranchId.Value))
                            //            branchIdList = edb.Branch.Where(b => b.Status == ConvertEnum.StatusTypeForActive && specialAreaList.Contains(b.ParentId.Value)).Select(b => b.Id).ToList();
                            //        else
                            //            branchIdList = edb.Branch.Where(b => b.Status == ConvertEnum.StatusTypeForActive && b.ParentId.Value == areaBranchId).Select(b => b.Id).ToList();

                            //        foreach (var bId in branchIdList)
                            //        {
                            //            // 循环添加非当前中心
                            //            if (bId != branchId)
                            //            {
                            //                var ub = new UserBranch
                            //                {
                            //                    UserId = userId,
                            //                    BranchId = bId,
                            //                    CreateBy = updateBy,
                            //                    CreateTime = DateTime.Now
                            //                };
                            //                edb.Entry(ub).State = EntityState.Added;
                            //            }
                            //        }
                            //    }
                            //}

                            #endregion
                        }

                        emeUserBranch.BranchId = branchId;
                        emeUserBranch.UpdateBy = updateBy;
                        emeUserBranch.UpdateTime = DateTime.Now;

                        edb.Entry(emeUserBranch).State = EntityState.Modified;
                    }

                    var emeStudent = edb.Student.FirstOrDefault(p => p.UserId == userId);

                    if (null != emeStudent)
                    {
                        if (!string.IsNullOrWhiteSpace(crmUser.CC))
                        {
                            var ccUserId =
                                edb.User.Where(c => c.UserName.Equals(crmUser.CC, StringComparison.CurrentCultureIgnoreCase))
                                    .Select(u => u.Id)
                                    .FirstOrDefault();
                            if (ccUserId != 0)
                            {
                                emeStudent.CC = ccUserId;

                                emeStudent.UpdateBy = updateBy;
                                emeStudent.UpdateTime = DateTime.Now;

                                edb.Entry(emeStudent).State = EntityState.Modified;
                            }
                        }
                    }

                    edb.SaveChanges();
                    AsyncUpdateAddressInfo(emeUserInfo);
                }
                catch (Exception e)
                {
                    QueueManager.AddExceptionLog(new ExceptionLogs()
                    {
                        ExceptionType = CommonHelper.To<int>(ExceptionType.Message),
                        Message = string.Format("UserBLL-UpdateUserForCrm:{0};{1};{2}", e.Message, e.InnerException, e.HelpLink),
                        IsTreat = false,
                        CreateBy = updateBy,
                        CreateTime = DateTime.Now
                    });

                    result.Status = 102;
                    result.Msg = "内部错误:" + e.Message;
                }
            }

            return result;
        }
Пример #5
0
        /// <summary>
        /// 作者:Ark
        /// 时间:2014-07-31
        /// 描述:用户预订课
        /// </summary>
        /// <param name="userId">(学员)用户编号</param>        
        /// <param name="productLevelId">产品级别编号(当前排课)</param>
        /// <param name="arrangeCourseId">排课编号</param>
        /// <param name="bookUserId">订课人编号</param>
        /// <param name="isForce"></param>
        /// <returns></returns>
        public string BookCourseByUserId(string bookCourseParams)
        {
            try
            {
                var ret = new ResultTiper { Status = 100 };
                Student student = null;
                var queryParams = JsonHelper.FromJson<BookCourseParamModel>(bookCourseParams);
                var userId = queryParams.UserId;
                var productLevelId = queryParams.ProductLevelId;
                var arrangeCourseId = queryParams.ArrangeCourseId;
                var bookUserId = queryParams.BookUserId;
                var isForce = queryParams.IsForce;

                if (userId.Value > 0)
                {
                    student = StudentBLL.GetStudentByUserId(userId.Value);
                }
                // 用户编号错误或用户不存在,非法操作
                if (userId <= 0 || null == student)
                {
                    ret.Status = 101;
                    ret.Msg = "用户编号错误或学员不存在,非法操作";
                    return JsonHelper.ToJson(ret);
                }

                var retValue = StudyBLL.CreateBookRecord(student.Id, productLevelId, queryParams.ContractLevelId, arrangeCourseId, bookUserId, ConvertEnum.BookSourceForEmeMini, isForce);
                ret.Status = retValue;

                switch (retValue)
                {
                    case 100:
                        //"课程预订成功!";
                        break;
                    case 101:
                        ret.Msg = "已达最大订课人数限制!";
                        break;
                    case 102:
                        ret.Msg = "已预订了该排课!";
                        break;
                    case 103:
                        ret.Msg = "您已预订该课程!";//所订课程是否已结课
                        break;
                    case 104:
                        ret.Msg = "学员在该时间段已经预定其他课程!";
                        break;
                    case 105:
                        ret.Msg = "排课信息已失效!";
                        break;
                    case 106:
                        ret.Msg = "订课信息提交失败!";
                        break;
                    case 107:
                        ret.Msg = "系统异常,请联系管理员!";
                        break;
                    case 108:
                        ret.Msg = "已过预订期限,需要提前一天预定!";
                        break;
                    case 109:
                        ret.Msg = "您的主修课课时已达最大课时量!";
                        break;
                    case 110:
                        ret.Msg = "您的选修课课时已达最大课时量!";
                        break;
                    default:
                        ret.Msg = "系统异常,请联系管理员!";
                        break;
                }

                return JsonHelper.ToJson(new
                {
                    ResultCode = string.Format("000{0}", ret.Status == 100 ? "000" : ret.Status.ToString()),
                    ResultMessage = ret.Msg
                });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #6
0
        /// <summary>
        /// 作者:Ark
        /// 时间:2014-07-31
        /// 描述:用户登录验证
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        public ResultTiper Login(string userName, string password)
        {
            ResultTiper ret = new ResultTiper { Status = 100 };

            if (string.IsNullOrWhiteSpace(userName))
            {
                ret.Status = 101;
                ret.Msg = "用户名不能为空!";
                return ret;
            }
            if (string.IsNullOrWhiteSpace(password))
            {
                ret.Status = 101;
                ret.Msg = "密码不能为空!";
                return ret;
            }

            FunctionResult fRet = UserBLL.UserLoginValidate(userName, SecurityHelper.GetMd5(password), UserType.Student);

            if (fRet.Status)
            {
                // 成功返回用户编号
                ret.ReturnValue = fRet.ReturnValue;
                ret.ReturnUserName = fRet.ReturnUserName;
            }
            else
            {
                ret.Status = 101;
                ret.Msg = fRet.Info;
            }

            return ret;
        }
Пример #7
0
        /// <summary>
        /// 作者:Kylin
        /// 时间:2015.03.19
        /// 描述:是否已点评,通过教师编号和排课编号(不使用)
        /// </summary>
        /// <param name="arrangeId"></param>
        /// <param name="teacherId"></param>
        /// <param name="studentId"></param>
        /// <returns></returns>
        public string IsExistCourseRateByTeacherId(string isExistCourseRateParam)
        {
            try
            {
                var ret = new ResultTiper { Status = 100, Msg = "未点评!" };
                var isExistCourseRateParamModel = JsonHelper.FromJson<IsExistCourseRateParamModel>(isExistCourseRateParam);
                var teacherId = StudyBLL.GetTeachRecordByArrangecourseId(isExistCourseRateParamModel.ArrangeCourseId).TeacherId;

                if (!isExistCourseRateParamModel.UserId.HasValue)
                {
                    return JsonHelper.ToJson(new
                    {
                        ResultCode = "000002",
                        ResultMessage = "学员编号异常"
                    });
                }

                var studentId = StudentBLL.GetStudentByUserId(isExistCourseRateParamModel.UserId.Value).Id;
                var result = RateBLL.IsExistCourseRateByTeacherId(isExistCourseRateParamModel.ArrangeCourseId,
                    teacherId, studentId);
                //ret = result ? new ResultTiper() { Status = 101, Msg = "已点评!" } : ret;
                return JsonHelper.ToJson(result ? new
                {
                    ResultCode = "000001",
                    ResultMessage = "已点评"
                } : new
                {
                    ResultCode = "000000",
                    ResultMessage = ""
                });
            }
            catch (Exception ex)
            {
                return JsonHelper.ToJson(new
                {
                    ResultCode = "000003",
                    ResultMessage = string.Format("系统异常;{0}", ex.Message)
                });
            }
        }
Пример #8
0
        /// <summary>
        /// 作者:Kylin
        /// 时间:2015.03.19
        /// 描述:是否已点评,通过教师编号和排课编号
        /// </summary>
        /// <param name="arrangeId"></param>
        /// <param name="studentId"></param>
        /// <param name="teacherId"></param>
        /// <returns></returns>
        public string IsExistCourseRateByStudentUserId(string isExistCourseRateParam)
        {
            try
            {
                var ret = new ResultTiper { Status = 100, Msg = "未点评!" };
                var isExistCourseRateParamModel = JsonHelper.FromJson<IsExistCourseRateParamModel>(isExistCourseRateParam);

                if (!isExistCourseRateParamModel.UserId.HasValue)
                {
                    return JsonHelper.ToJson(new
                    {
                        ResultCode = "000003",
                        ResultMessage = "学员编号异常"
                    });
                }

                var result = RateBLL.IsExistCourseRateByStudentUserId(isExistCourseRateParamModel.ArrangeCourseId, isExistCourseRateParamModel.UserId.Value);
                return JsonHelper.ToJson(result ? new
                {
                    ResultCode = "000001",
                    ResultMessage = "已点评"
                } : new
                {
                    ResultCode = "000000",
                    ResultMessage = ""
                });
            }
            catch (Exception ex)
            {
                return JsonHelper.ToJson(new
                {
                    ResultCode = "000002",
                    ResultMessage = string.Format("系统异常;{0}", ex.Message)
                });
            }
        }
Пример #9
0
        /// <summary>
        /// 作者:KYLIN
        /// 时间:2015-07-14
        /// 描述:用户预订课
        /// </summary>
        /// <param name="studentId">(学员)编号</param>        
        /// <param name="productLevelId">产品级别编号(当前排课)</param>
        /// <param name="contractLevelId"></param>
        /// <param name="arrangeCourseId">排课编号</param>
        /// <param name="bookUserId">订课人编号</param>
        /// <param name="isForce"></param>
        /// <returns></returns>
        public string CreateBookCourseByUserId(string bookCourseParams)
        {
            try
            {
                var ret = new ResultTiper { Status = 100, Msg = string.Empty };
                var queryParams = JsonHelper.FromJson<BookCourseParamModel>(bookCourseParams);
                // 用户编号错误或用户不存在,非法操作
                if (!queryParams.StudentId.HasValue)
                {
                    ret.Status = 101;
                    ret.Msg = "用户编号错误或学员不存在,非法操作";
                    return JsonHelper.ToJson(ret);
                }

                var retValue = StudyBLL.CreateBookRecord(queryParams.StudentId.Value,
                    queryParams.ProductLevelId,
                    queryParams.ContractLevelId,
                    queryParams.ArrangeCourseId,
                    queryParams.BookUserId,
                    queryParams.BookSource,
                    queryParams.IsForce);
                ret.Status = retValue;
                switch (retValue)
                {
                    case 100:
                        ret.Msg = "课程预订成功!";
                        break;
                    case 101:
                        ret.Msg = "已达最大订课人数限制!";
                        ret.Status = 101;
                        break;
                    case 102:
                        ret.Msg = "已预订了该排课!";
                        ret.Status = 102;
                        break;
                    case 103:
                        ret.Msg = "所订课程是否已结课!";
                        ret.Status = 103;
                        break;
                    case 104:
                        ret.Msg = "学员在该时间段已经预定其他课程!";
                        ret.Status = 104;
                        break;
                    case 105:
                        ret.Msg = "排课信息已失效!";
                        ret.Status = 105;
                        break;
                    case 106:
                        ret.Msg = "订课信息提交失败!";
                        ret.Status = 106;
                        break;
                    case 107:
                        ret.Msg = "系统异常,请联系管理员!";
                        ret.Status = 107;
                        break;
                    case 108:
                        ret.Msg = "已过预订期限,需要提前一天预定!";
                        ret.Status = 108;
                        break;
                    case 109:
                        ret.Msg = "您的主修课课时已达最大课时量!";
                        ret.Status = 109;
                        break;
                    case 110:
                        ret.Msg = "您的选修课课时已达最大课时量!";
                        ret.Status = 110;
                        break;
                    default:
                        ret.Msg = "系统异常,请联系管理员!";
                        ret.Status = 111;
                        break;
                }
                return JsonHelper.ToJson(ret);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }