Example #1
0
        /// <summary>
        /// 提交物业2订单
        /// </summary>
        /// <returns></returns>
        private Boolean propSecOrder()
        {
            try
            {
                PropSecAccess     access = new PropSecAccess();
                PropSecOrderParam param  = new PropSecOrderParam();
                param.shopType     = PayAccess.isWtLkl(Payment.propSecPayParam.IcParams);
                param.AMOUNT       = Payment.propSecPayParam.UserInputMoney;
                param.paymentAmout = "1";
                param.SC10009      = Payment.propSecPayParam.ManufacturerNum;
                param.SC10010      = Payment.propSecPayParam.CardType;
                param.SC10007      = ConfigSysParam.ResidentialNo;
                param.SC10014      = Payment.propSecPayParam.PrimaryKey;
                param.SC10008      = Payment.propSecPayParam.SC10008;
                param.merchantNo   = Payment.propSecPayParam.merchantNo;
                PropSecOrderInfo orderinfo = access.order(param);

                if ("9999".Equals(orderinfo.msgrsp.retcode))
                {
                    return(false);
                }
                if ("1234".Equals(orderinfo.msgrsp.retcode))
                {
                    return(false);
                }
                if (!"0000".Equals(orderinfo.msgrsp.retcode))
                {
                    return(false);
                }
                Payment.propSecPayParam.p = new PayParam();
                //获取商户号
                Payment.propSecPayParam.p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO;
                //获取终端号
                Payment.propSecPayParam.p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO;
                //订单实际支付金额
                Payment.propSecPayParam.p.rechageAmount = orderinfo.msgrsp.realAmout;
                //交易订单号
                Payment.propSecPayParam.p.orderNo     = orderinfo.msgrsp.orderNo;
                Payment.propSecPayParam.RechageAmount = orderinfo.msgrsp.realAmout;
                Payment.propSecPayParam.orderInfo     = orderinfo;
                log.Write("订单提交成功:云平台订单号:" + orderinfo.msgrsp.orderNo);
                return(true);
            }
            catch (Exception ex)
            {
            }
            return(false);
        }
Example #2
0
 private void read()
 {
     try
     {
         isRead = false;
         try
         {
             SysBLL.Player("读取中.wav");
             showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "正在读卡,请稍后...");
             PropSecAccess     access = new PropSecAccess();
             PropSecQueryParam param  = new PropSecQueryParam();
             param.SC10009       = Payment.propSecPayParam.ManufacturerNum;
             param.SC10010       = Payment.propSecPayParam.CardType;
             param.SC10011       = "01";
             param.ResidentialNo = ConfigSysParam.ResidentialNo;
             PropSecQueryInfo info = access.query(param);
             if (!"0000".Equals(info.msgrsp.retcode))
             {
                 PrintInfo(info.msgrsp.retshow);
                 return;
             }
             StringBuilder result1 = new StringBuilder(2048);
             StringBuilder result2 = new StringBuilder(2048);
             log.Write("物业2读卡:业务类型:08,卡片种类:" + Payment.propSecPayParam.CardType + ",业务步骤:" + info.msgrsp.SC10011 + ",表具厂商编号:" + Payment.propSecPayParam.ManufacturerNum + ",输入信息:" + info.msgrsp.SC20003 + ",端口:" + SysConfigHelper.readerNode("PropSwwyName"));
             IntPtr status = PropSwwy.WF002(
                 new StringBuilder("08"),                                       //业务类型
                 new StringBuilder(Payment.propSecPayParam.CardType),           //卡片种类
                 new StringBuilder("01"),                                       //卡片版本
                 new StringBuilder(info.msgrsp.SC10011),                        //,业务步骤
                 new StringBuilder(""),                                         //卡片唯一识别号
                 new StringBuilder(""),                                         //物业公司编号
                 new StringBuilder(""),                                         //小区编号
                 new StringBuilder(Payment.propSecPayParam.ManufacturerNum),    //表具产商编号
                 new StringBuilder(SysConfigHelper.readerNode("PropSwwyName")), //端口号
                 result1,                                                       //返回说明
                 new StringBuilder(info.msgrsp.SC20003),                        //业务输入信息
                 result2                                                        //业务返回信息
                 );
             string result = Marshal.PtrToStringAnsi(status);
             log.Write("物业2读卡返回:" + result);
             if (!"0".Equals(result))
             {
                 PrintInfo("读取失败,请重试...");
                 isRead = true;
                 return;
             }
             PropSecCardJson card = new PropSec().JsonToModel(result2.ToString());
             log.Write("result2.ToString():" + result2.ToString());
             Payment.propSecPayParam.propMeterInfo = access.queryMeter(ConfigSysParam.ResidentialNo, card.G_1802);
             log.Write("获取表具列表返回码:" + Payment.propSecPayParam.propMeterInfo.msgrsp.retcode);
             if (!"0000".Equals(Payment.propSecPayParam.propMeterInfo.msgrsp.retcode))
             {
                 if (Payment.propSecPayParam.propMeterInfo.msgrsp.retshow != null)
                 {
                     if (Payment.propSecPayParam.propMeterInfo.msgrsp.retshow.Length > 0)
                     {
                         showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, Payment.propSecPayParam.propMeterInfo.msgrsp.retshow);
                     }
                     else
                     {
                         showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "读卡失败,请稍后再试...");
                     }
                 }
                 else
                 {
                     showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "读卡失败,请稍后再试...");
                 }
                 SysBLL.Player("读物业卡2失败.wav");
                 return;
             }
             if (DictParam.Prop2TanAnNum.Equals(Payment.propSecPayParam.ManufacturerNum))
             {
                 log.Write("G_2015:" + card.G_2015);
                 if (card.G_2015 != null)
                 {
                     if (!"0".Equals(card.G_2015))
                     {
                         showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "请将上次的气量插入到表内再进行充值!");
                         return;
                     }
                 }
                 else
                 {
                     showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "读卡失败,请稍后再试....");
                     SysBLL.Player("读物业卡2失败.wav");
                     return;
                 }
             }
             Payment.propSecPayParam.SC10007    = card.G_0806;
             Payment.propSecPayParam.SC10008    = card.G_1802;
             Payment.propSecPayParam.merchantNo = info.msgrsp.merchantNo;
             Util.JumpUtil.jumpCommonPage("FormPropSec01_2");
             return;
         }
         catch (ThreadAbortException ae) { log.Write("error:物业2读卡异常:" + ae.Message); }
         catch (Exception ex)
         {
             PrintInfo("读取失败,请重试...");
             SysBLL.Player("读物业卡2失败.wav");
             log.Write("error:FormGasGoldenCardStep02:UserControl_Loaded:" + ex.Message);
             return;
         }
     }
     catch (AccessViolationException ave)
     {
         PrintInfo("读取失败,请重试....");
         //SysBLL.Player("读物业卡2失败.wav");
         log.Write("error1:" + ave.Message);
     }
     catch (ThreadAbortException ae) { log.Write("error:物业2读卡异常:" + ae.Message); }
     catch (WtException e)
     {
         PrintInfo("读取失败,请重试....");
         //SysBLL.Player("读物业卡2失败.wav");
         log.Write("error:2" + e.Message);
     }
     catch (Exception e)
     {
         PrintInfo("读取失败,请重试....");
         SysBLL.Player("读物业卡2失败.wav");
         log.Write("error:3" + e.Message);
     }
     finally
     {
         isRead = true;
     }
 }