예제 #1
0
        /// <summary>
        /// 取消订单
        /// </summary>
        /// <param name="baseApi"></param>
        /// <returns></returns>
        public object Do_ReturnBill(BaseApi baseApi)
        {
            BookingListParam param = JsonConvert.DeserializeObject <BookingListParam>(baseApi.param.ToString());

            if (param == null)
            {
                throw new ApiException(CodeMessage.InvalidParam, "InvalidParam");
            }
            if (param.billId == null || param.billId == "")
            {
                throw new ApiException(CodeMessage.InterfaceValueError, "InterfaceValueError");
            }
            string  openId  = Utils.GetOpenID(baseApi.token);
            OpenDao openDao = new OpenDao();

            BILLLIST billList = openDao.getBillListById(param.billId, openId);

            if (billList == null)
            {
                throw new ApiException(CodeMessage.RetrunBillStateError, "RetrunBillStateError");
            }
            if (billList.bookingState != "0" && billList.bookingState != "1")
            {
                throw new ApiException(CodeMessage.RetrunBillStateError, "RetrunBillStateError");
            }
            if (openDao.returnBill(param.billId, openId))
            {
                return(true);
            }
            else
            {
                throw new ApiException(CodeMessage.RetrunBillError, "RetrunBillError");
            }
        }
예제 #2
0
        /// <summary>
        /// 获取订单信息
        /// </summary>
        /// <param name="baseApi"></param>
        /// <returns></returns>
        public object Do_GetBookingListById(BaseApi baseApi)
        {
            BookingListParam param = JsonConvert.DeserializeObject <BookingListParam>(baseApi.param.ToString());

            if (param == null)
            {
                throw new ApiException(CodeMessage.InvalidParam, "InvalidParam");
            }
            //if (param.posCode == null || param.posCode == "")
            //{
            //    throw new ApiException(CodeMessage.InterfaceValueError, "InterfaceValueError");
            //}
            if (param.billId == null || param.billId == "")
            {
                throw new ApiException(CodeMessage.InterfaceValueError, "InterfaceValueError");
            }
            string  openId  = Utils.GetOpenID(baseApi.token);
            OpenDao openDao = new OpenDao();

            //新增同步是否取票
            openDao.updateBillInfoPrintState(param.billId);
            //处理10分取消未支付订单
            openDao.UpdateBookingStatusBy10Minute(openId);

            return(openDao.getBillListById(param.billId, openId));
        }