public YoungMemberQueryRessult YoungMemberQuery(string SPID, string CodeValue, string ExtendField)
    {
        YoungMemberQueryRessult Result = new YoungMemberQueryRessult();
        Result.Result = ErrorDefinition.IError_Result_UnknowError_Code;
        Result.ErrorDescription = "";
        string TestStr = "";

        StringBuilder strLog = new StringBuilder();
        try
        {
            #region 数据校验
            if (CommonUtility.IsEmpty(SPID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(CodeValue))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidRealName_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidRealName_Msg + ",不能为空";
                return Result;
            }
            #endregion
            string ProvinceID = "";
            string Areaid = "";
            strLog.AppendFormat("根据手机号码查询所在地区省ID\r\n");
            Result.Result = BTForBusinessSystemInterfaceRules.GetPhoneTOArea(CodeValue, out ProvinceID, out Areaid, out Result.ErrorDescription);

            strLog.AppendFormat("根据手机号码查询所在地区省ID返回:Result:{0},ErrMsg:{1},ProvinceID:{2},AreaId:{3}\r\n", Result.Result, Result.ErrorDescription, ProvinceID, Areaid);
            string SOO_ID = "1";
            string LAN_ID = "";

            if (!Areaid.StartsWith("0"))
            {
                Areaid = "0" + Areaid;
            }
            string AREA_NBR =Areaid;
            string ACC_NBR = CodeValue;
            string PROD_CLASS = "12";
            ClubMember cm = new ClubMember();
            int qryLanIdResult = CIP2BizRules.GetYangLanID(Areaid, out LAN_ID, out Result.ErrorDescription);
            strLog.AppendFormat("查询LanId:qryLanIdResult:{0},LAN_ID:{1}\r\n",qryLanIdResult,LAN_ID);
            if (qryLanIdResult == 0)
            {
                Result.Result = CrmSSO.GetCustIdByAccNbr(ProvinceID, SOO_ID, LAN_ID, AREA_NBR, ACC_NBR, PROD_CLASS, "", this.Context, out cm, out Result.ErrorDescription, out TestStr);
                Result.ClubMember = cm;
                strLog.AppendFormat("Result.Result:{0}\r\n",Result.Result);
                strLog.AppendFormat("ClubMember.CUST_ID={0},MEMBER_ID={1},MEMBER_NAME={2},MEMBER_CODE={3},MEMBERSHIP_LEVEL={4}\r\n", Result.ClubMember.CUST_ID, Result.ClubMember.MEMBER_ID, Result.ClubMember.MEMBER_NAME, Result.ClubMember.MEMBER_CODE, Result.ClubMember.MEMBERSHIP_LEVEL);

            }
            else {
                strLog.AppendFormat("查询LanId失败\r\n");
            }
        }
        catch (Exception ex)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + ex.Message;
            strLog.AppendFormat(ex.ToString());
        }
        finally
        {
            BTUCenterInterfaceLog.CenterForBizTourLog("YoungMumberQuery", strLog);
        }
        return Result;
    }
Beispiel #2
0
        public static int GetCustIdByAccNbr(string UAProvinceID,string SOO_ID, string LAN_ID, string AREA_NBR, string ACC_NBR, string PROD_CLASS, string ScoreBesttoneSPID, HttpContext context, out ClubMember cm,out string ErrMsg, out string TestStr)
        {
            int Result = -19999;
            ErrMsg = "";
            TestStr = "";
            string str = "";
            string rStr = "";
            cm = new ClubMember();
            StringBuilder param = new StringBuilder();
            try
            {

                if (ScoreBesttoneSPID == "")
                {
                    ScoreBesttoneSPID = System.Configuration.ConfigurationManager.AppSettings["ScoreBesttoneSPID"];
                }

                string BusCode = "BUS17006";                                    //ҵ���ܱ���
                string ServiceCode = "SVC33003";                                //�ӿ�Э�����
                string ServiceContractVer = "SVC3300320120719";                 //Э�鵱ǰʹ�õİ汾��
                string ActionCode = "0";                                        //�����ʶ
                //������ˮ��
                string date = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                if (count >= 9)
                    count = 0;
                else
                    count = count + 1;
                string TransactionID = "1000000020" + date + count.ToString();
                string ServiceLevel = "1";                                      //����ȼ�,��������ȼ�
                string SrcOrgID = "100000";                                     //���𷽻�������
                string SrcSysID = "1000000020";                                 //����(ϵͳ/ƽ̨)����
                string SrcSysSign = System.Configuration.ConfigurationManager.AppSettings["SrcSysSign"];    //����(ϵͳ/ƽ̨)ǩ��
                //��ط���������
                string DstOrgID = "";
                DstOrgID = CommonBizRules.GetReginCodeByProvinceID(UAProvinceID, context);
                if (DstOrgID == "")
                {
                    ErrMsg = "ָ��ʡ��Ӧ������ط���������";
                    return -1;
                }
                //��ط�(ϵͳ/ƽ̨)����
                string DstSysID = "";
                DstSysID = CommonBizRules.GetSPOuterIDBySPID(UAProvinceID + "999999", context);
                if (DstSysID == "")
                {
                    ErrMsg = "ָ��ʡ��Ӧ������ط�(ϵͳ/ƽ̨)����";
                    return -1;
                }
                string ReqTime = DateTime.Now.ToString("yyyyMMddHHMMss");                       //����ʱ�䣬ʱ���ʽ�ַ�

                //����Crm��ѯxml
                XMLExchange xMLExchange = new XMLExchange();
                str =xMLExchange.BuildYoungQryMemberXML(BusCode, ServiceCode, ServiceContractVer, ActionCode, TransactionID,
                ServiceLevel, SrcOrgID, SrcSysID, SrcSysSign, DstOrgID, DstSysID, ReqTime,
                SOO_ID, LAN_ID, AREA_NBR, ACC_NBR, PROD_CLASS);

                StringBuilder requestXml = new StringBuilder();

                #region ƴ������xml�ַ���

                requestXml.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                requestXml.Append("<ContractRoot>");
                requestXml.Append("<TcpCont>");
                requestXml.AppendFormat("<ActionCode>{0}</ActionCode>", ActionCode);
                requestXml.AppendFormat("<TransactionID>{0}</TransactionID>", TransactionID);
                requestXml.AppendFormat("<ServiceLevel>{0}</ServiceLevel>", ServiceLevel);
                requestXml.AppendFormat("<BusCode>{0}</BusCode>", BusCode);
                requestXml.AppendFormat("<ServiceCode>{0}</ServiceCode>", ServiceCode);
                requestXml.AppendFormat("<ServiceContractVer>{0}</ServiceContractVer>", ServiceContractVer);
                requestXml.AppendFormat("<SrcOrgID>{0}</SrcOrgID>", SrcOrgID);
                requestXml.AppendFormat("<SrcSysID>{0}</SrcSysID>", SrcSysID);
                requestXml.AppendFormat("<SrcSysSign>{0}</SrcSysSign>", SrcSysSign);
                requestXml.AppendFormat("<DstOrgID>{0}</DstOrgID>", DstOrgID);
                requestXml.AppendFormat("<DstSysID>{0}</DstSysID>", DstSysID);
                requestXml.AppendFormat("<ReqTime>{0}</ReqTime>", ReqTime);
                requestXml.Append("</TcpCont>");
                requestXml.Append("<SvcCont>");
                requestXml.Append("<SOO type=\"QRY_CLUB_MEMBER_REQ_TYPE\">");
                requestXml.Append("<PUB_REQ>");
                requestXml.Append("<SOO_ID>1</SOO_ID>");
                requestXml.Append("</PUB_REQ>");
                requestXml.AppendFormat("<PROD_INST_ID>:getProdInstIdByAccNbr({0},{1},{2},{3})</PROD_INST_ID>", LAN_ID, AREA_NBR, ACC_NBR, PROD_CLASS);    //LAN_ID + "," + AREA_NBR + "," + ACC_NBR + "," + PROD_CLASS
                requestXml.Append("</SOO>");
                requestXml.Append("</SvcCont>");
                requestXml.Append("</ContractRoot>");

                #endregion

                //��Crm������ѯ
                DEPService obj = new DEPService();
                obj.Url = System.Configuration.ConfigurationManager.AppSettings["DEPServiceURL"];
                rStr = obj.exchange(requestXml.ToString());
                TestStr = rStr;

                QryYoungInfoReturn qryYoungInfoReturn =  xMLExchange.AnalysisQryYoungMumberXML(rStr);

                cm.ASSESS_DATE = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.ASSESS_DATE;
                cm.CUST_ID = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.CUST_ID;
                cm.EFF_DATE = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.EFF_DATE;
                cm.EXP_DATE = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.EXP_DATE;
                cm.MEMBER_CODE = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.MEMBER_CODE;
                cm.MEMBER_ID = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.MEMBER_ID;
                cm.MEMBER_NAME = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.MEMBER_NAME;
                cm.MEMBERSHIP_LEVEL = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.MEMBERSHIP_LEVEL;
                cm.STATUS_CD = qryYoungInfoReturn.SvcCont.SOO.CLUB_MEMBER.STATUS_CD;
                Result = 0;
            }
            catch (Exception ex)
            {
                ErrMsg = ex.Message.ToString();
                Result = -29999;

            }
            finally
            {
                LogCrmSSOPost(str);
                LogCrmSSOReturn(rStr);
            }
            return Result;
        }