Exemplo n.º 1
0
        private ETCResponse ListUpLoad(ETCPaymentRecord record)
        {
            StringBuilder response = new StringBuilder(100);
            var           request  = new
            {
                UserName      = UserName,
                ProvinceNo    = ProvinceNo,
                CityNo        = CityNo,
                ListType      = record.ListType.ToString(),
                ListNo        = record.ListNo,
                KeyServiceNo  = record.KeyServiceNo,
                TradeType     = record.TradeType.ToString(),
                TermCode      = record.TermCode,
                TermTradeNo   = record.TermTradeNo,
                CardTradeNo   = record.CardTradeNo,
                Tac           = record.Tac,
                OBUID         = record.OBUID == null ? string.Empty : record.OBUID,
                OBUNO         = record.OBUNO == null ? string.Empty : record.OBUNO,
                CardNo        = record.CardNo,
                CashMoney     = record.CashMoney.ToString(),
                Balance       = record.Balance.ToString(),
                TradeDevice   = record.TradeDevice.ToString(),
                VehPicture    = record.VehPicture,
                VehPictureLen = record.VehPictureLen.ToString(),
                SquadDate     = record.SquadDate,
                ShiftID       = record.ShiftID,
                ExTime        = record.ExTime,
                ExAreaNo      = record.ExAreaNo,
                ExGateNo      = record.ExGateNo,
                ExLaneNo      = record.ExLaneNo,
                ExOperatorNo  = record.ExOperatorNo,
                ExVehPlate    = record.ExVehPlate,
                ExVehType     = record.ExVehType,
                ExVehClass    = record.ExVehClass,
                EnTime        = record.EnTime,
                EnOperatorNo  = record.EnOperatorNo,
                EnAreaNo      = record.EnAreaNo,
                EnGateNo      = record.EnGateNo,
                EnLaneNo      = record.EnLaneNo,
                EnVehPlate    = record.EnVehPlate,
                EnVehType     = record.EnVehType,
                EnVehClass    = record.EnVehClass,
            };
            var n = ETCInterop.ListUpLoad(int.Parse(LaneNo), JsonConvert.SerializeObject(request), response);

            if (n != 0)
            {
                return new ETCResponse()
                       {
                           ErrorCode = n
                       }
            }
            ;
            var ret = JsonConvert.DeserializeObject <WriteCardResponse>(response.ToString());

            ret.Content = response.ToString();
            return(ret);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 上传扣费流水
        /// </summary>
        /// <param name="record"></param>
        /// <returns></returns>
        public ETCResponse ListUpLoad(ETCPaymentList record)
        {
            int           plen     = 1000;
            StringBuilder response = new StringBuilder(plen);
            var           request  = new
            {
                ListType      = record.ListType.ToString(),
                ListNo        = record.ListNo,
                KeyServiceNo  = record.KeyServiceNo,
                TradeType     = record.TradeType.ToString(),
                TermCode      = record.TermCode,
                TermTradeNo   = record.TermTradeNo,
                CardTradeNo   = record.CardTradeNo,
                Tac           = record.Tac,
                OBUID         = record.OBUID == null ? string.Empty : record.OBUID,
                OBUNO         = record.OBUNO == null ? string.Empty : record.OBUNO,
                CardNo        = record.CardNo,
                CashMoney     = record.CashMoney.ToString(),
                Balance       = record.Balance.ToString(),
                TradeDevice   = record.TradeDevice.ToString(),
                VehPicture    = record.VehPicture,
                VehPictureLen = record.VehPictureLen.ToString(),
                SquadDate     = record.SquadDate,
                ShiftID       = record.ShiftID,
                ExTime        = record.ExTime,
                ExAreaNo      = record.ExAreaNo,
                ExGateNo      = record.ExGateNo,
                ExLaneNo      = record.ExLaneNo,
                ExOperatorNo  = record.ExOperatorNo,
                ExVehPlate    = record.ExVehPlate,
                ExVehType     = record.ExVehType,
                ExVehClass    = record.ExVehClass,
                EnTime        = record.EnTime,
                EnOperatorNo  = record.EnOperatorNo,
                EnAreaNo      = record.EnAreaNo,
                EnGateNo      = record.EnGateNo,
                EnLaneNo      = record.EnLaneNo,
                EnVehPlate    = record.EnVehPlate,
                EnVehType     = record.EnVehType,
                EnVehClass    = record.EnVehClass,
            };
            var strReq = JsonConvert.SerializeObject(request);
            var n      = ETCInterop.ListUpLoad(int.Parse(LaneNo), strReq, response, ref plen);

            if (n != 0)
            {
                Ralid.GeneralLibrary.LOG.FileLog.Log("未成功上传流水" + LaneNo.ToString(), strReq);
                return(new ETCResponse()
                {
                    ErrorCode = n
                });
            }
            var ret = JsonConvert.DeserializeObject <WriteCardResponse>(response.ToString());

            ret.Content = response.ToString();
            return(ret);
        }