Ejemplo n.º 1
0
        internal static InterBankNoticeLetterInfo OnRetrieveNoticeLetter(DateTime tradeDate, string tradeOrg, string tellerNo, InterBankNoticeQueryInfo info, out string outmsg)
        {
            outmsg = "";
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData reqdata = null;
            MessageData recdata = null;
            Guid msgid = Guid.Empty;
            InterBankNoticeLetterInfo resultdetail = null;
            try
            {
                msgid = MsgTransferUtility.RetrieveNoticeLetter(tradeDate,tradeOrg, tellerNo, info, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Core, tellerNo, tradeOrg, (int)MessageBizType.CoreInterBankNoticeLetter, codemsg, info.NoticeID);
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Core, codemsg));
#endif

                InterBankNoticeLetterData data = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as InterBankNoticeLetterData;
                if (data != null)
                {
                    if (!String.IsNullOrEmpty(data.SyserrHandler.Message))
                    {
                        outmsg = data.SyserrHandler.Message;
                    }
                    else if (data.OmsgHandler.NUM_ENT > 0)
                    {
                        outmsg = MsgHandlerEntry.ExtractOMsg(data);
                    }
                    else
                    {
                        if (data.OData != null)
                        {
                            resultdetail = new InterBankNoticeLetterInfo();
                            resultdetail.ACCOUNT_DATE = CommonDataHelper.StrTrimer(data.OData.ACCOUNT_DATE, null);
                            resultdetail.NOTICE_NO = CommonDataHelper.StrTrimer(data.OData.NOTICE_NO, null);
                            resultdetail.NOTICE_TYPE = string.IsNullOrEmpty(data.OData.NOTICE_TYPE) ? 
                                AidTypeDefine.INTER_BANK_NOTICE_TYPE.OpenAccount : (AidTypeDefine.INTER_BANK_NOTICE_TYPE)Enum.Parse(typeof(AidTypeDefine.INTER_BANK_NOTICE_TYPE), CommonDataHelper.StrTrimer(data.OData.NOTICE_TYPE, null));
                            resultdetail.BUSINESS_TYPE = string.IsNullOrEmpty(data.OData.BUSINESS_TYPE) ?
                                AidTypeDefine.INTER_BANK_BIZ_TERM_TYPE.Current : (AidTypeDefine.INTER_BANK_BIZ_TERM_TYPE)Enum.Parse(typeof(AidTypeDefine.INTER_BANK_BIZ_TERM_TYPE), CommonDataHelper.StrTrimer(data.OData.BUSINESS_TYPE, null));
                            resultdetail.ACCOUNT = CommonDataHelper.StrTrimer(data.OData.ACCOUNT_NO, null);
                            resultdetail.CURRENCY = CommonDataHelper.StrTrimer(data.OData.CURRENCY, null);
                            resultdetail.CUSTOMER_TYPE = CommonDataHelper.StrTrimer(data.OData.CUSTOMER_TYPE, null);
                            resultdetail.CASH_PROPERTY = CommonDataHelper.StrTrimer(data.OData.CASH_PROPERTY, null);
                            resultdetail.PRODUCT_TYPE = CommonDataHelper.StrTrimer(data.OData.PRODUCT_TYPE, null);
                            resultdetail.PRODUCT_CODE = CommonDataHelper.StrTrimer(data.OData.PRODUCT_CODE, null);
                            resultdetail.DEPOSIT_TYPE = string.IsNullOrEmpty(data.OData.DEPOSIT_TYPE) ? 
                                AidTypeDefine.INTER_BANK_DEPOSITING_CATEGORY.Other_Banks : (AidTypeDefine.INTER_BANK_DEPOSITING_CATEGORY)Enum.Parse(typeof(AidTypeDefine.INTER_BANK_DEPOSITING_CATEGORY), CommonDataHelper.StrTrimer(data.OData.DEPOSIT_TYPE, null));
                            resultdetail.ACCOUNT_PROPERTY = CommonDataHelper.StrTrimer(data.OData.ACCOUNT_PROPERTY, null);
                            resultdetail.ACCOUNT_TYPE = CommonDataHelper.StrTrimer(data.OData.ACCOUNT_TYPE, null);
                            resultdetail.CURRENT_ACCOUNT = CommonDataHelper.StrTrimer(data.OData.CURRENT_ACCOUNT, null);
                            resultdetail.INTEREST_ACCOUNT = CommonDataHelper.StrTrimer(data.OData.INTEREST_ACCOUNT, null);
                            resultdetail.FIXED_NEW_ACCOUNT = CommonDataHelper.StrTrimer(data.OData.FIXED_NEW_ACCOUNT, null);
                            resultdetail.VOUCHER_NO = CommonDataHelper.StrTrimer(data.OData.VOUCHER_NO, null);
                            resultdetail.VOUCHER_NEW_NO = CommonDataHelper.StrTrimer(data.OData.VOUCHER_NEW_NO, null);
                            resultdetail.AUTO_REDEPO = CommonDataHelper.StrTrimer(data.OData.AUTO_REDEPO, null) == "1";
                            resultdetail.DEPOSIT_TERM = CommonDataHelper.StrTrimer(data.OData.DEPOSIT_TERM, null);
                            resultdetail.VALUE_DATE = CommonDataHelper.StrTrimer(data.OData.VALUE_DATE, null);
                            resultdetail.MATURITY_DATE = CommonDataHelper.StrTrimer(data.OData.MATURITY_DATE, null);
                            resultdetail.AMOUNT = CommonDataHelper.ConvertDecimal(CommonDataHelper.StrTrimer(data.OData.AMOUNT, null), 6);
                            resultdetail.RATE = CommonDataHelper.ConvertDecimal(CommonDataHelper.StrTrimer(data.OData.RATE, null), 6);
                            resultdetail.INTEREST_BEARING_MANNER = string.IsNullOrEmpty(data.OData.INTEREST_BEARING_MANNER) ? 
                                AidTypeDefine.INTER_BANK_COUPON_TYPE.InterestWithPrincipal : (AidTypeDefine.INTER_BANK_COUPON_TYPE)Enum.Parse(typeof(AidTypeDefine.INTER_BANK_COUPON_TYPE),  CommonDataHelper.StrTrimer(data.OData.INTEREST_BEARING_MANNER, null));
                            resultdetail.INTEREST = CommonDataHelper.ConvertDecimal(CommonDataHelper.StrTrimer(data.OData.INTEREST, null), 6);
                            resultdetail.CUSTOMER_CODE = CommonDataHelper.StrTrimer(data.OData.CUSTOMER_CODE, null);
                            resultdetail.BANK_FLAG = CommonDataHelper.StrTrimer(data.OData.BANK_FLAG, null);
                            resultdetail.HANDLE_ORGNAZTION = CommonDataHelper.StrTrimer(data.OData.HANDLE_ORGNAZTION, null);
                            resultdetail.APPROVE_ORGNAZTION = CommonDataHelper.StrTrimer(data.OData.APPROVE_ORGNAZTION, null);
                            resultdetail.HANDLE_TELLER = CommonDataHelper.StrTrimer(data.OData.HANDLE_TELLER, null);
                            resultdetail.APPROVE_TELLER = CommonDataHelper.StrTrimer(data.OData.APPROVE_TELLER, null);
                            resultdetail.HANDLE_FLAG = CommonDataHelper.StrTrimer(data.OData.HANDLE_FLAG, null);
                            resultdetail.TRADE_FLOW_NO = CommonDataHelper.StrTrimer(data.OData.TRADE_FLOW_NO, null);
                            resultdetail.CHILD_TRADE_FLOW_NO = CommonDataHelper.StrTrimer(data.OData.CHILD_TRADE_FLOW_NO, null);
                            resultdetail.TELLER_FLOW_NO = CommonDataHelper.StrTrimer(data.OData.TELLER_FLOW_NO, null);
                            resultdetail.RECORD_FLAG = CommonDataHelper.StrTrimer(data.OData.RECORD_FLAG, null);
                            resultdetail.BOOK_TYPE = CommonDataHelper.StrTrimer(data.OData.BOOK_TYPE, null);
                            resultdetail.ACCOUNT_NAME = CommonDataHelper.StrTrimer(data.OData.ACCOUNT_NAME, null);
                            resultdetail.BALANCE = CommonDataHelper.ConvertDecimal(CommonDataHelper.StrTrimer(data.OData.BALANCE, null),6);
                            resultdetail.SUM_AMOUNT = CommonDataHelper.ConvertDecimal(CommonDataHelper.StrTrimer(data.OData.SUM_AMOUNT, null),6);
                            resultdetail.RESERVE = CommonDataHelper.StrTrimer(data.OData.RESERVE, null);                            
                        }                        
                        return resultdetail;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }

                OnUpdateDBLog(recdata.MessageID, outmsg, MsgLogState.RecvFailed, out dbexception);
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                return resultdetail;
            }
        }
Ejemplo n.º 2
0
 private void TestForQuery(InterBankNoticeLetterInfo rData)
 {
     StringBuilder result = new StringBuilder();
     if (rData == null)
     {
         MessageBox.Show("返回数据为空!");
     }
     else
     {
         result.AppendLine();
         result.Append("ODATA:");
         result.AppendFormat("会计日期:{0};通知单编号:{1};通知单类型:{2};业务类型:{3};", rData.ACCOUNT_DATE, rData.NOTICE_NO, rData.NOTICE_TYPE, rData.BUSINESS_TYPE);
         result.AppendLine();
         result.AppendFormat("账号:{0};币种:{1};外币客户类别:{2};钞汇属性:{3};", rData.ACCOUNT, rData.CURRENCY, rData.CUSTOMER_TYPE, rData.CASH_PROPERTY);
         result.AppendLine();
         result.AppendFormat("产品类别:{0};产品代码:{1};存款种类:{2};账户性质:{3};帐户类型:{4}", rData.PRODUCT_TYPE, rData.PRODUCT_CODE, rData.DEPOSIT_TYPE, rData.ACCOUNT_PROPERTY, rData.ACCOUNT_TYPE);
         result.AppendLine();
         result.AppendFormat("资金来源活期账号:{0};收息账号:{1};定期部提新账号:{2};凭证号码:{3};新凭证号码:{4};", rData.CURRENT_ACCOUNT, rData.INTEREST_ACCOUNT, rData.FIXED_NEW_ACCOUNT, rData.VOUCHER_NO, rData.VOUCHER_NEW_NO);
         result.AppendLine();
         result.AppendFormat("自动转存:{0};定期存期:{1};起息日期:{2};到期日期:{3};交易金额:{4};", rData.AUTO_REDEPO, rData.DEPOSIT_TERM, rData.VALUE_DATE, rData.MATURITY_DATE, rData.AMOUNT);
         result.AppendLine();
         result.AppendFormat("利率:{0};计息方式:{1};利息金额:{2};客户内码:{3};银行集团企业标志:{4};", rData.RATE, rData.INTEREST_BEARING_MANNER, rData.INTEREST, rData.CUSTOMER_CODE, rData.BANK_FLAG);
         result.AppendLine();
         result.AppendFormat("经办机构:{0};审批机构:{1};操作柜员:{2};审核柜员:{3};", rData.HANDLE_ORGNAZTION, rData.APPROVE_ORGNAZTION, rData.HANDLE_TELLER, rData.APPROVE_TELLER);
         result.AppendLine();
         result.AppendFormat("处理标志:{0};原交易流水号:{1};子交易流水号:{2};柜员流水号:{3};记录状态:{4};存单折类型:{5}", rData.HANDLE_FLAG, rData.TRADE_FLOW_NO, rData.CHILD_TRADE_FLOW_NO, rData.TELLER_FLOW_NO, rData.RECORD_FLAG, rData.BOOK_TYPE);
         result.AppendLine();
         result.AppendFormat("户名:{0};余额:{1};本息合计:{2};备用:{3}", rData.ACCOUNT_NAME, rData.BALANCE, rData.SUM_AMOUNT, rData.RESERVE);
     }
     textResult.Text = result.ToString();
 }