internal static CoreCustomer OnRetrieveCstm(String tellerno, String orgno, DateTime tradedate, String internalcode, out String outmsg) { outmsg = ""; CoreCustomer customer = null; byte[] codemsg = null; bool sent = false; string dbexception = ""; MessageData reqdata = null; MessageData recdata = null; Guid msgid = Guid.Empty; try { msgid = MsgTransferUtility.RetrieveCstm(tellerno, orgno, tradedate, internalcode, ref codemsg); reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Core, tellerno, orgno, (int)MessageBizType.CoreCstmRetrieve, codemsg); #if MQSYNC recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent); #else recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Core, codemsg)); #endif RetrieveCstmData cstmdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as RetrieveCstmData; if (cstmdata != null) { if (!String.IsNullOrEmpty(cstmdata.OData.CUS_CDE)) { if (customer == null) { customer = new CoreCustomer(); } customer.InternalCode = CommonDataHelper.StrTrimer(cstmdata.OData.CUS_CDE, null); customer.CustomerNO = CommonDataHelper.StrTrimer(cstmdata.OData.CUS_NO, null); customer.CustomerType = CommonDataHelper.StrTrimer(cstmdata.OData.CUS_TYP, null); customer.CustomerName = CommonDataHelper.StrTrimer(cstmdata.OData.CUS_NAM, null); customer.CustomerOName = CommonDataHelper.StrTrimer(cstmdata.OData.CUS_ONAM, null); customer.CustomerEName = CommonDataHelper.StrTrimer(cstmdata.OData.CUS_ENAM, null); customer.Nation = CommonDataHelper.StrTrimer(cstmdata.OData.NATION, null); customer.VIPType = CommonDataHelper.StrTrimer(cstmdata.OData.VIP_TYP, null); customer.CustomerStatus = CommonDataHelper.StrTrimer(cstmdata.OData.CUS_STS, null); customer.AddressSN = CommonDataHelper.StrTrimer(cstmdata.OData.ADD_SN, null); customer.Address = CommonDataHelper.StrTrimer(cstmdata.OData.ADDR, null); customer.TeleSN = CommonDataHelper.StrTrimer(cstmdata.OData.TEL_SN, null); customer.TeleNO = CommonDataHelper.StrTrimer(cstmdata.OData.TEL_NO, null); customer.MobileNO = CommonDataHelper.StrTrimer(cstmdata.OData.MBL_NO, null); customer.DistrictType = CommonDataHelper.StrTrimer(cstmdata.OData.CMB_QYLX,null); customer.CreatedDept = CommonDataHelper.StrTrimer(cstmdata.OData.CRT_PDT,null); customer.CreatedOperater = CommonDataHelper.StrTrimer(cstmdata.OData.CRT_OPR, null); customer.CreatedDate = CommonDataHelper.StrTrimer(cstmdata.OData.CRT_DTE, null); customer.UpdatedDept = CommonDataHelper.StrTrimer(cstmdata.OData.UP_PDT, null); customer.UpdatedOperator = CommonDataHelper.StrTrimer(cstmdata.OData.UP_OPR, null); customer.UpdatedDate = CommonDataHelper.StrTrimer(cstmdata.OData.UP_DTE, null); //MQMsgCommonHelper.UpdateMQLog(recdata, null, outmsg, MsgLogState.RecvSucceed, out dbexception); return customer; } else { if (!String.IsNullOrEmpty(cstmdata.SyserrHandler.Message)) { outmsg = cstmdata.SyserrHandler.Message; } else { outmsg = MsgHandlerEntry.ExtractOMsg(cstmdata); } } } else { outmsg = MsgHandlerEntry.Type_Convert_Error; } OnUpdateDBLog(recdata.MessageID, outmsg, MsgLogState.RecvFailed, out dbexception); return customer; } catch (Exception ex) { outmsg = ex.Message; OnException(sent, reqdata, recdata, msgid, ex, outmsg); return customer; } }
/// <summary> /// 查询客户 /// </summary> /// <param name="orgno">机构号</param> /// <param name="tellerno">柜员号</param> /// <param name="tradedate">发生日期</param> /// <param name="internalcode">客户内码</param> /// <param name="customer">返回客户对象</param> /// <param name="outmsg">出错返回信息</param> /// <returns></returns> public static bool RetrieveCustomer(String orgno, String tellerno, DateTime tradedate, String internalcode, out CoreCustomer customer, out String outmsg) { customer = ClientSyncHelper.OnRetrieveCstm(tellerno, orgno, tradedate, internalcode, out outmsg); if (customer != null) { return true; } outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Core, outmsg); return false; }