示例#1
0
        public IHttpActionResult SearchParkingRecord(ParkingSearchRequest model)
        {
            GetRecordListResponse <ParkingRecordResponse> response = new GetRecordListResponse <ParkingRecordResponse>()
            {
                IsSuccess      = true,
                MessageCode    = (int)ApiBaseErrorCode.API_SUCCESS,
                MessageContent = ApiBaseErrorCode.API_SUCCESS.ToString()
            };

            if (string.IsNullOrWhiteSpace(model.ParkingCode))
            {
                response.IsSuccess      = false;
                response.MessageCode    = (int)ApiBaseErrorCode.API_PARAM_ERROR;
                response.MessageContent = "车场编码不能为空,请检查";
                return(Ok(response));
            }
            GetRecordListResponse <ParkingRecordResponse> opengatereasonlistmodel = _reportManager.SearchParkingRecord(model);

            if (opengatereasonlistmodel != null)
            {
                response = opengatereasonlistmodel;
            }
            else
            {
                response.IsSuccess      = false;
                response.MessageCode    = (int)ApiPersonnelErrorCode.API_DATA_NULL_ERROR;
                response.MessageContent = ApiPersonnelErrorCode.API_DATA_NULL_ERROR.ToString();
            }
            return(Ok(response));
        }
示例#2
0
        /// <summary>
        ///   查询停车记录(报表)
        /// </summary>
        /// <param name="parkCode"></param>
        /// <returns></returns>
        public GetRecordListResponse <ParkingRecordResponse> SearchParkingRecord(ParkingSearchRequest model)
        {
            GetRecordListResponse <ParkingRecordResponse> responseModel = null;
            RequestFujicaReportStatistical requestFujica = new RequestFujicaReportStatistical();
            //请求方法
            string servername = "SearchRecord/SearchParkingRecord";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["Id"]          = model.Id;
            dicParam["ParkingCode"] = model.ParkingCode;
            if (model.LicensePlate != null)
            {
                dicParam["LicensePlate"] = model.LicensePlate;
            }
            if (model.Entrance != null)
            {
                dicParam["Entrance"] = model.Entrance;
            }
            if (model.Export != null)
            {
                dicParam["Export"] = model.Export;
            }
            if (model.CarType != null)
            {
                dicParam["CarType"] = model.CarType;
            }
            if (model.CardType != null)
            {
                dicParam["CardType"] = model.CardType;
            }
            if (model.InThroughType != null)
            {
                dicParam["InThroughType"] = model.InThroughType;
            }
            if (model.OutThroughType != null)
            {
                dicParam["OutThroughType"] = model.OutThroughType;
            }
            if (model.OutParkingOperator != null)
            {
                dicParam["OutParkingOperator"] = model.OutParkingOperator;
            }
            if (model.SpecialCar != null)
            {
                dicParam["SpecialCar"] = model.SpecialCar;
            }
            if (model.AdmissionStartDate != null)
            {
                dicParam["AdmissionStartDate"] = model.AdmissionStartDate;
            }
            if (model.AppearanceStartDate != null)
            {
                dicParam["AppearanceStartDate"] = model.AppearanceStartDate;
            }
            if (model.AdmissionEndDate != null)
            {
                dicParam["AdmissionEndDate"] = model.AdmissionEndDate;
            }
            if (model.AppearanceEndDate != null)
            {
                dicParam["AppearanceEndDate"] = model.AppearanceEndDate;
            }
            if (model.NextToken != null)
            {
                dicParam["NextToken"] = model.NextToken;                          //就是第一次查询,需要制定当前页  页大小 ,需要下一页的时候,直接给这个nexttoken就可以了
            }
            dicParam["PageIndex"] = model.PageIndex;
            dicParam["PageSize"]  = model.PageSize;
            dicParam["Sort"]      = model.Sort;
            dicParam["FieldSort"] = model.FieldSort;
            bool falg = requestFujica.RequestFujicaReport(servername, dicParam);

            if (falg)
            {
                string fujicaResult = requestFujica.FujicaResult;
                if (!string.IsNullOrEmpty(fujicaResult))
                {
                    //解析返回参数json字符串
                    GetRecordListResponse <ParkingRecordResponse> response = m_serializer.Deserialize <GetRecordListResponse <ParkingRecordResponse> >(fujicaResult);
                    responseModel = response;
                }
            }
            return(responseModel);
        }